diff --git a/UnityProject/Assets/HotUpdateResources/Dll/Hidden~/HotUpdateScripts.dll b/UnityProject/Assets/HotUpdateResources/Dll/Hidden~/HotUpdateScripts.dll index 136a4545..eea0c00d 100644 Binary files a/UnityProject/Assets/HotUpdateResources/Dll/Hidden~/HotUpdateScripts.dll and b/UnityProject/Assets/HotUpdateResources/Dll/Hidden~/HotUpdateScripts.dll differ diff --git a/UnityProject/Assets/HotUpdateResources/Dll/Hidden~/HotUpdateScripts.pdb b/UnityProject/Assets/HotUpdateResources/Dll/Hidden~/HotUpdateScripts.pdb index 59635483..4883934c 100644 Binary files a/UnityProject/Assets/HotUpdateResources/Dll/Hidden~/HotUpdateScripts.pdb and b/UnityProject/Assets/HotUpdateResources/Dll/Hidden~/HotUpdateScripts.pdb differ diff --git a/UnityProject/HotUpdateScripts/JEngine/Core/JBehaviour.cs b/UnityProject/HotUpdateScripts/JEngine/Core/JBehaviour.cs index 315eb961..8382835a 100644 --- a/UnityProject/HotUpdateScripts/JEngine/Core/JBehaviour.cs +++ b/UnityProject/HotUpdateScripts/JEngine/Core/JBehaviour.cs @@ -151,6 +151,7 @@ private static async void JBehavioursLoop() { Stopwatch sw = new Stopwatch(); JBehaviour jb; + float duration, time; for(; ; ) { if (!Application.isPlaying) break; @@ -177,7 +178,6 @@ private static async void JBehavioursLoop() jb.Frequency = 1; } - int duration; if (jb.FrameMode)//等待 { duration = (int)(jb.Frequency / ((float)Application.targetFrameRate <= 0 ? GameStats.FPS : Application.targetFrameRate) * 1000f); @@ -193,7 +193,9 @@ private static async void JBehavioursLoop() duration = 1; } - if (Time.realtimeSinceStartup - jb.CurTime < duration / 1000f) + duration /= 1000f; + + if (Time.realtimeSinceStartup - jb.CurTime < duration) { continue; } @@ -215,7 +217,7 @@ private static async void JBehavioursLoop() sw.Stop(); //操作时间 - var time = sw.ElapsedMilliseconds / 1000f + duration / 1000f + 0.001f; + time = sw.ElapsedMilliseconds / 1000f + 0.001f + duration; jb.LoopCounts++; jb.LoopDeltaTime = time; jb.TotalTime += time; diff --git a/UnityProject/HotUpdateScripts/JEngine/Examples/Core/NinoDemo.cs b/UnityProject/HotUpdateScripts/JEngine/Examples/Core/NinoDemo.cs index 88b07e7c..2d7fd003 100644 --- a/UnityProject/HotUpdateScripts/JEngine/Examples/Core/NinoDemo.cs +++ b/UnityProject/HotUpdateScripts/JEngine/Examples/Core/NinoDemo.cs @@ -63,7 +63,7 @@ public void Awake() }); _list.Add(new NinoTestData { - sex = NinoTestData.Sex.Male, + sex = NinoTestData.Sex.Female, name = "B", id = 1, isHasPet = true @@ -93,7 +93,7 @@ public void Awake() }; _arr[1] = new NinoTestData { - sex = NinoTestData.Sex.Male, + sex = NinoTestData.Sex.Female, name = "D", id = 3, isHasPet = false @@ -102,8 +102,8 @@ public void Awake() buf = Serializer.Serialize(_arr); Log.Print($"Nino 将_arr数据序列化为了 {buf.Length} bytes"); - var _arr2 = Deserializer.Deserialize>(buf); - Log.Print($"Nino 反序列化了一个_arr2,内部有{_arr2.Count}个元素"); + var _arr2 = Deserializer.Deserialize (buf); + Log.Print($"Nino 反序列化了一个_arr2,内部有{_arr2.Length}个元素"); Log.Print($"_arr2[0].sex = {_arr2[0].sex}\n" + $"_arr2[0].name = {_arr2[0].name}\n" + $"_arr2[0].id = {_arr2[0].id}\n" +