internal static void Init() { uiThreadId = Thread.CurrentThread.ManagedThreadId; UiSyncContext = SynchronizationContext.Current; BackgroundSyncContext = new SynchronizationContext(); beforeUpdates = new ContinuationProcessorGroup(); afterUpdates = new ContinuationProcessorGroup(); }
static void Initialize() { unityThreadId = Thread.CurrentThread.ManagedThreadId; UnitySyncContext = SynchronizationContext.Current; BackgroundSyncContext = new SynchronizationContext(); // TODO: confirm this produces desired behaviour updates = new ContinuationProcessorGroup(); lateUpdates = new ContinuationProcessorGroup(); fixedUpdates = new ContinuationProcessorGroup(); Instance = new GameObject("[Async Manager]").AddComponent <AsyncManager>(); DontDestroyOnLoad(Instance); }
public static void Initialize() { unityThreadId = Thread.CurrentThread.ManagedThreadId; UnitySyncContext = SynchronizationContext.Current; BackgroundSyncContext = new SynchronizationContext(); // TODO: confirm this produces desired behaviour updates = new ContinuationProcessorGroup(); lateUpdates = new ContinuationProcessorGroup(); fixedUpdates = new ContinuationProcessorGroup(); Instance = new GameObject("Async Manager").AddComponent <AsyncManager>(); if (!Application.isEditor) // DontDestroyOnLoad can not be called in editor mode { DontDestroyOnLoad(Instance); } }