コード例 #1
0
    public static GameObject RegisterListener(LevelLoadListener.OnDoneFunc onDone)
    {
        GameObject        gameObject        = new GameObject("LevelLoadListener");
        LevelLoadListener levelLoadListener = gameObject.AddComponent <LevelLoadListener>();

        DontDestroyOnLoad(levelLoadListener);
        levelLoadListener.onDone = onDone;
        return(gameObject);
    }
コード例 #2
0
 void OnLevelWasLoaded()
 {
     LevelLoadListener.OnDoneFunc onDoneFunc = this.onDone;
     this.onDone = null;
     Destroy(base.gameObject);
     if (onDoneFunc != null)
     {
         onDoneFunc();
     }
     EventListener.SceneLoad();         // Invoke custom event
 }
コード例 #3
0
 void OnDestroy()
 {
     this.onDone = null;
 }