예제 #1
0
        public UITimerController(GameConfig gameConfig, UITimerView timerView, IGameManager gameManager)
        {
            StartTimer(gameConfig, 0, timerView);

            gameManager.OnNewLevelStarted += levelIndex => StartTimer(gameConfig, levelIndex, timerView);
            timerView.TimeIsUp            += gameManager.GameOver;
        }
예제 #2
0
        public void StartTimer(GameConfig gameConfig, int level, UITimerView timerView)
        {
            var configList = gameConfig.MazeLevelsConfigList;

            if (configList.Count - 1 < level)
            {
                return;
            }

            var currentConfig = configList[level];

            timerView.StartTimer(currentConfig.Timer);
        }