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(); } }
public void RegisterHandler(DelegateHandleSceneEvent toRegister) { sceneHandler = toRegister; }