diff --git a/Assets/Scripts/Controller/ScoreController.cs b/Assets/Scripts/Controller/ScoreController.cs index 32a51452..449b455e 100644 --- a/Assets/Scripts/Controller/ScoreController.cs +++ b/Assets/Scripts/Controller/ScoreController.cs @@ -47,10 +47,16 @@ public class ScoreController : MonoSingleton } - public string GetModuleDictJson(string name = "") + public string GetModuleDictJson(string name = "", string id = "", string sum = "") { var resultDict = new Dictionary(); + DateTime curTime = DateTime.Now; resultDict.Add("name", name); + resultDict.Add("id", id); + resultDict.Add("sum", sum); + resultDict.Add("time", curTime.ToString("yyyy.MM.dd")); + resultDict.Add("year", curTime.Year); + resultDict.Add("month", curTime.Month); foreach (var dataPair in moduleDict) { var data = dataPair.Value; @@ -62,7 +68,12 @@ public class ScoreController : MonoSingleton string key = $"{scoreStep.step}{scoreStep.name}"; resultDict[key] = scoreStep.value; - resultDict.Add(key + "Time", string.IsNullOrEmpty(scoreStep.time) == true ? "" : scoreStep.time); + string value = "\u00A0"; + if (string.IsNullOrEmpty(scoreStep.time) == false) + { + value = scoreStep.time; + } + resultDict.Add(key + "Time", value); } } } diff --git a/Assets/Scripts/UI/UIScore.cs b/Assets/Scripts/UI/UIScore.cs index aa6f96cc..6532eba7 100644 --- a/Assets/Scripts/UI/UIScore.cs +++ b/Assets/Scripts/UI/UIScore.cs @@ -33,7 +33,7 @@ namespace QFramework.Example -#if UNITY_WEBGL +#if UNITY_WEBGL&&!UNITY_EDITOR ResLoader loader = ResLoader.Allocate(); loader.Add2Load(Global.reportDemoPath.ToLocalBytesResName(), (success, res) => { @@ -45,7 +45,7 @@ namespace QFramework.Example } }); loader.LoadAsync(); -#elif UNITY_STANDALONE_WIN +#elif UNITY_STANDALONE_WIN||UNITY_EDITOR DownLoad.interactable = false; AsposeHelper.Writer(GetScoreDataJson(), () => { @@ -60,7 +60,7 @@ namespace QFramework.Example public string GetScoreDataJson() { - return ScoreController.Instance.GetModuleDictJson(InputName.text); + return ScoreController.Instance.GetModuleDictJson(InputName.text, InputId.text, this.Sum.text); } @@ -108,6 +108,7 @@ namespace QFramework.Example startTime = item.Value.time, endTime = item.Value.time, seq = seq, + StepState = (int)item.Value.value == float.Parse(item.Value.sum) ? "全部正确" : "有错误" }); seq++; }