예제 #1
0
 private void LoadDone(ISceneLoaded handler, int sceneID)
 {
     if (handler == null)
     {
         return;
     }
     handler.OnSceneLoaded(SceneManager.GetSceneAt(sceneID));
 }
예제 #2
0
 public SceneLoader OnSceneLoaded(ISceneLoaded handler, int sceneID)
 {
     if (sceneID >= handlers.Length)
     {
         return(this);
     }
     handlers[sceneID] = handler;
     return(this);
 }
예제 #3
0
    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();
                }
            }
        }
    }