分数读取后赋值
This commit is contained in:
parent
ce401f8b53
commit
096c742205
|
@ -70,4 +70,12 @@ public abstract class ScoreBase : MonoBehaviour
|
|||
Debug.LogError(JsonConvert.SerializeObject(steps));
|
||||
return steps;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置科目得分,用于断线重连恢复
|
||||
/// </summary>
|
||||
public void setCurrentScore(float _score)
|
||||
{
|
||||
this.currentScore = _score;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ using Newtonsoft.Json.Linq;
|
|||
using System.IO;
|
||||
using LitJson;
|
||||
using System;
|
||||
using Unity.Burst.CompilerServices;
|
||||
|
||||
/// <summary>
|
||||
/// 断线重连管理
|
||||
|
@ -205,6 +206,19 @@ public class ReconnectMgr : SingletonMono<ReconnectMgr>
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//»Ö¸´¼Ç¼µÄ·ÖÊý
|
||||
ScoreBase scoreBase = FindFirstObjectByType<ScoreBase>();
|
||||
Dictionary<int, ScoreSubjectStep> reconnectScore = scoreBase.GetStepScore();
|
||||
foreach (var item in UserExamStat.allSubScore)
|
||||
{
|
||||
if (reconnectScore.ContainsKey(item.index))
|
||||
{
|
||||
reconnectScore[item.index].currentScore = item.currentScore;
|
||||
reconnectScore[item.index].isDone = item.isDone;
|
||||
}
|
||||
}
|
||||
scoreBase.setCurrentScore(UserExamStat.currentScore);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue