diff --git a/CLUNL.Unity3D/Sync/Dispatcher.cs b/CLUNL.Unity3D/Sync/Dispatcher.cs index 4674d47..fabb461 100644 --- a/CLUNL.Unity3D/Sync/Dispatcher.cs +++ b/CLUNL.Unity3D/Sync/Dispatcher.cs @@ -12,6 +12,17 @@ public class Dispatcher //static ImmutableQueue iactions = ImmutableQueue.Empty; static ConcurrentQueue actions = new ConcurrentQueue(); static object _lock = new object(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool Inited() + { + return init; + } + static bool init = false; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MarkInit() + { + init = true; + } /// /// Call to perform a sync operation every frame. /// diff --git a/CLUNL.Unity3D/Sync/DispatcherController.cs b/CLUNL.Unity3D/Sync/DispatcherController.cs index 04d91c6..7df2025 100644 --- a/CLUNL.Unity3D/Sync/DispatcherController.cs +++ b/CLUNL.Unity3D/Sync/DispatcherController.cs @@ -15,6 +15,7 @@ public void Start() Destroy(gameObject); return; } + Dispatcher.MarkInit(); DontDestroyOnLoad(gameObject); } public void Update()