Exemple #1
0
 void Awake()
 {
     _closeButton.onClick.AddListener(OnCloseClick);
     _mainMenuButton.onClick.AddListener(OnMainMenuClick);
     _restartButton.onClick.AddListener(OnRestartClick);
     _sceneController = ControllersBox.Get <ScenesController>();
 }
        public void OnInit()
        {
            _activeLevelBlocks = new List <LevelBlock>();

            var lcc     = ControllersBox.Get <LevelConfigController>();
            var levelId = LevelController.CurrentLevel;

            _elementsGroups = lcc.Config.GetElementsGroups(levelId.Level);
            _levelBlocks    = lcc.Config.LevelBlocks;

            for (var i = 0; i < MinCountBlocks; i++)
            {
                CreateNewBlock(false);
            }

            EventManager.Subscribe <PlayerIntoBlockTriggerEnter>(this, OnPlayerIntoBlockTriggerEnter);
        }
Exemple #3
0
        void OnStartClick()
        {
            var lc = ControllersBox.Get <LevelController>();

            _sceneController?.OpenLevel(lc.CurrentLevel);
        }
Exemple #4
0
 void Awake()
 {
     _startGameButton.onClick.AddListener(OnStartClick);
     _sceneController = ControllersBox.Get <ScenesController>();
 }
Exemple #5
0
        void Start()
        {
            var fcc = ControllersBox.Get <FoodsController>();

            _foodCountText.text = fcc.CurrentFoodCount.ToString();
        }
Exemple #6
0
 void OnClickNextLevel()
 {
     Hide();
     ControllersBox.Get <LevelController>().CompleteLevel();
 }