Ejemplo n.º 1
0
 private void OnLevelFinishLoading(Scene scene, LoadSceneMode mode)
 {
     if (scene.name == "Board")
     {
         gameState = _state.board;
         StartBoard();
         LevelPostStart();
         sceneHandler = null;
         //background = GameObject.Instantiate(backgroundPrefabs[currentLevel % backgroundPrefabs.Count]);
         background = GameObject.Instantiate((GameObject)Resources.Load("Backgrounds/" + backgrounds[currentLevel % backgrounds.Count]));
     }
     if (scene.name == "World")
     {
         if (board)
         {
             Destroy(board);
         }
         if (worldController == null)
         {
             worldController = GameObject.Instantiate(worldControllerPrefab);
         }
         worldController.GetComponent <WorldController>().DoRender();
     }
 }
Ejemplo n.º 2
0
 public void RegisterHandler(DelegateHandleSceneEvent toRegister)
 {
     sceneHandler = toRegister;
 }