private void LoadDone(ISceneLoaded handler, int sceneID) { if (handler == null) { return; } handler.OnSceneLoaded(SceneManager.GetSceneAt(sceneID)); }
public SceneLoader OnSceneLoaded(ISceneLoaded handler, int sceneID) { if (sceneID >= handlers.Length) { return(this); } handlers[sceneID] = handler; return(this); }
private static void CallSceneLoaded() { GameObject[] gameObjects = FindObjectsOfType <GameObject>(); foreach (GameObject go in gameObjects) { if (PrefabUtility.GetPrefabType(go) == PrefabType.Prefab) { continue; } foreach (MonoBehaviour mb in go.GetComponents <MonoBehaviour>()) { ISceneLoaded sceneGui = mb as ISceneLoaded; if (sceneGui != null) { sceneGui.OnSceneLoaded(); } } } }