Skip to content

Commit c773e03

Browse files
Merge pull request #407 from JasonXuDeveloper/development
fixed loom thread bug + add new symbol
2 parents 1ba0146 + 3db2df3 commit c773e03

File tree

2 files changed

+10
-5
lines changed
  • UnityProject/Assets/Dependencies/JEngine

2 files changed

+10
-5
lines changed

UnityProject/Assets/Dependencies/JEngine/Core/Util/Loom.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using UnityEngine;
32
using System.Collections.Generic;
43
using System.Collections.Concurrent;
54

@@ -103,25 +102,31 @@ public static void QueueOnMainThread(Action action)
103102
/// <param name="time"></param>
104103
public static void QueueOnMainThread(Action action, float time)
105104
{
106-
Delayed.Enqueue(new DelayedQueueItem { Time = Time.time + time, Action = action });
105+
Delayed.Enqueue(new DelayedQueueItem { Time = _curTime + time, Action = action });
107106
}
108107

109108
/// <summary>
110109
/// Current actions to process
111110
/// </summary>
112111
private static readonly List<Action> CurActions = new List<Action>(100);
112+
113+
/// <summary>
114+
/// Current time
115+
/// </summary>
116+
private static float _curTime;
113117

114118
/// <summary>
115119
/// Update loop on main thread
116120
/// </summary>
117121
static void Update()
118122
{
123+
_curTime = UnityEngine.Time.time;
119124
var i = Delayed.Count;
120125
while (i-- > 0)
121126
{
122127
if (Delayed.TryDequeue(out var item))
123128
{
124-
if (item.Time <= Time.time)
129+
if (item.Time <= _curTime)
125130
{
126131
CurActions.Add(item.Action);
127132
}
@@ -140,7 +145,7 @@ static void Update()
140145
}
141146
catch (Exception e)
142147
{
143-
Debug.LogException(e);
148+
UnityEngine.Debug.LogException(e);
144149
}
145150
}
146151

UnityProject/Assets/Dependencies/JEngine/Editor/JEngineTools/EditorUpdates/SetData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private static void InjectDefineSymbol()
5959
var group = BuildPipeline.GetBuildTargetGroup(target);
6060
var org = PlayerSettings.GetScriptingDefineSymbolsForGroup(group);
6161
var d = PlayerSettings.GetScriptingDefineSymbolsForGroup(group);
62-
string[] Symbols = new string[] { "INIT_JE" };
62+
string[] Symbols = new string[] { "INIT_JE", "ILRuntime" };
6363
List<string> dfList = d.Split(';').ToList();
6464
dfList.AddRange(Symbols.Except(dfList));
6565
d = string.Join(";", dfList.Distinct().ToArray());

0 commit comments

Comments
 (0)