Example #1
0
        public void Initialize(IGameOverChecker gameOverChecker, IWinChecker winChecker, Action onPauseButtonClick)
        {
            Clear();

            _pauseButton.onClick.AddListener(() => { onPauseButtonClick(); });

            _gameOverChecker = gameOverChecker;
            _gameOverChecker.OnRemainingValueChanged += OnLoseConditionCounterChange;
            OnLoseConditionCounterChange(_gameOverChecker.RemainingValue);

            _winChecker = winChecker;
            _winChecker.OnTargetsChange += OnTargetsChange;

            foreach (var targetItem in _winChecker.Targets)
            {
                var newTargetItem = Instantiate(_targetItemPrefab, _targetItemsContainer, false);
                newTargetItem.Initialize(targetItem);
                _targetItems.Add(newTargetItem);
            }
        }
Example #2
0
 public GameOverMessege(IGameOverChecker checker, PlayerController winner, bool timeOut)
 {
     Checker = checker;
     Winner  = winner;
     TimeOut = timeOut;
 }