public static void Destroy(UnityObject obj, float time) { if (obj != null) { obj.Destroy(); } }
public static void DestroyImmediate(UnityObject obj) { if (obj != null) { obj.Destroy(); } // TODO: WE should probably clean up after this }
internal static void UnloadCurrentLevel() { foreach (UnityObject obj in objects.Values) { if (obj is GameObject) { GameObject gObj = (GameObject)obj; if (!dontDestroyOnLoad.Contains(gObj)) { UnityObject.Destroy(gObj); gObj.active = false; } } } }