void OnDisable() { if (instance == this) { instance = null; } }
static void Initialize() { if(!initialized) { if(!Application.isPlaying) return; initialized = true; GameObject go = new GameObject("ThreadScheduler"); instance = go.AddComponent<ThreadScheduler>(); } }
static void Initialize() { if (!initialized) { if (!Application.isPlaying) { return; } initialized = true; GameObject go = new GameObject("ThreadScheduler"); instance = go.AddComponent <ThreadScheduler>(); } }
void Awake() { instance = this; initialized = true; }
void OnDisable() { if(instance == this) { instance = null; } }