private void BuildLevel(Level level) { foreach (PuzzlePiece puzzle in level.LeftSide) { GameObject clone = Instantiate(puzzlePrefab); PuzzleController pc = clone.GetComponent <PuzzleController>(); pc.Init(puzzle); leftPuzzlePool.Add(pc); puzzlesToSpawnPool.Add(pc); puzzleMap.Add(puzzle, pc); clone.SetActive(false); } foreach (PuzzlePiece puzzle in level.RightSide) { GameObject clone = Instantiate(puzzlePrefab); PuzzleController pc = clone.GetComponent <PuzzleController>(); pc.Init(puzzle); rightPuzzlePool.Add(pc); puzzlesToSpawnPool.Add(pc); puzzleMap.Add(puzzle, pc); clone.SetActive(false); } }
public void Init() { //.. _instance = this; _isPaused = false; _cameraRaycaster.Init(); _puzzleController.Init(); _dialogueUI.Init(_player.GetPlayerConversant); onPlayerInteractEvent += _pcController.OnPlayerInteracted; onPlayerInteractEvent += _puzzleController.OnPlayerInteracted; }
public void PushStartButton() { flagController.Isplay = true; puzzleController.Init(); }