Exemple #1
0
        public void Enter()
        {
            if (gameData.levelObject != null)
            {
                gameData.levelObject.SetActive(false);
                gameData.levelObject = null;
            }

            gameData.levelObject = gameObjectFactory.FetchLevel();
            gameData.levelObject.SetActive(true);

            LevelMap levelMap = gameData.levelObject.GetComponent <LevelMap>();

            _activePlayer = levelMap.GetPlayer();
            _activeBoxes  = levelMap.GetBoxes();
            _activeWalls  = levelMap.GetWalls();
            _activeGoals  = levelMap.GetGoals();
            _activeKeys   = levelMap.GetKeys();
            _activeLocks  = levelMap.GetLocks();

            cellSize = gameData.cellSize;

            levelComplete = false;
            enableUpdate  = true;

            levelPlayPanel = gameObjectFactory.levelPlayPanelObject.GetComponent <LevelPlayPanel>();
            levelPlayPanel.Show();

            sfxPlayer = gameObjectFactory.sfxPlayerObject.GetComponent <SFXPlayer>();
        }
        public void Enter()
        {
            sfxPlayer = gameObjectFactory.sfxPlayerObject.GetComponent <SFXPlayer>();

            levelEnterPanel = gameObjectFactory.levelEnterPanelObject.GetComponent <LevelEnterPanel>();

            levelEnterPanel.OnShowComplete += EnterComplete;
            levelEnterPanel.SetLevelNumber(gameData.levelIndex + 1);
            levelEnterPanel.Show();
        }