Esempio n. 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);
        }
Esempio n. 3
0
        void OnStartClick()
        {
            var lc = ControllersBox.Get <LevelController>();

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

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