public static void Destroy() { if (_this) { StopAll(); _this = null; } }
public static Coroutine Run(IEnumerator func) { if (_this == null) { GameObject target = new GameObject("COROUTINES"); target.hideFlags = HideFlags.HideAndDontSave; UnityEngine.Object.DontDestroyOnLoad(target); _this = target.AddComponent <CoreCoroutines>(); } return(_this.StartCoroutine(func)); }
public static Coroutine Run(IEnumerator function) { if (_this == null) { GameObject go = new GameObject("~COROUTINES"); GameObject.DontDestroyOnLoad(go); go.hideFlags = HideFlags.HideAndDontSave; _this = go.AddComponent <CoreCoroutines>(); } return(_this.StartCoroutine(function)); }
public static Coroutine Run(IEnumerator function) { if (_this == null) { GameObject target = new GameObject("COROUTINES"); target.hideFlags = HideFlags.HideAndDontSave; UnityEngine.Object.DontDestroyOnLoad(target); _this = target.AddComponent<CoreCoroutines>(); } return _this.StartCoroutine(function); }