static void Init() { #if UNITY_EDITOR if (!Application.isPlaying) { return; } #endif if (instance == null) { instance = (new GameObject("DelayDestory")).AddComponent <DelayDestory>(); //instance.gameObject.hideFlags = HideFlags.HideAndDontSave; } }
static public void Destroy(GameObject go) { #if UNITY_EDITOR if (Application.isPlaying) { DelayDestory.Destroy(go); } else { DelayDestory.DestroyImmediate(go); } #else DelayDestory.Destroy(go); #endif }