Пример #1
0
    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);
        }
    }
Пример #2
0
    public void Init()
    {
        //..
        _instance = this;
        _isPaused = false;

        _cameraRaycaster.Init();
        _puzzleController.Init();
        _dialogueUI.Init(_player.GetPlayerConversant);

        onPlayerInteractEvent += _pcController.OnPlayerInteracted;
        onPlayerInteractEvent += _puzzleController.OnPlayerInteracted;
    }
Пример #3
0
 public void PushStartButton()
 {
     flagController.Isplay = true;
     puzzleController.Init();
 }