Ejemplo n.º 1
0
        private void InitializeRestartButtons(IUiElementsGenerator uiElementsGenerator)
        {
            var buttons = uiElementsGenerator.CreateAndGetGameRestartButtons();

            _startStandardGameBtn = buttons[0];
            _startBuffedGameBtn   = buttons[1];
            _startStandardGameBtn.onClick.AddListener(StartDefaultGame);
            _startBuffedGameBtn.onClick.AddListener(StartBuffedGame);
        }
Ejemplo n.º 2
0
 public PlayerUiController(Stat[] stats, Buff[] buffs, int playerCount, IUiElementsGenerator uiGenerator)
 {
     _uiGenerator  = uiGenerator;
     _defaultStats = stats;
     _defaultBuffs = buffs;
     _playerCount  = playerCount;
     PlayerController.PlayerBuffAddedEvent   += OnPlayerBuffAdded;
     PlayerController.PlayerStatChangedEvent += OnPlayerStatChanged;
     PlayerController.PlayerDiedEvent        += OnPlayerDied;
     GameController.GameRestartedEvent       += OnGameRestarted;
     GameController.GameEndedEvent           += OnGameEnded;
     InitializePlayerUis();
 }
Ejemplo n.º 3
0
 public PlayerUiControllerFactory(IResourcesRepository resourcesRepository, IUiElementsGenerator uiElementsGenerator)
 {
     PlayerUiController = new PlayerUiController(resourcesRepository.PlayerStats, resourcesRepository.PlayerBuffs,
                                                 resourcesRepository.GameSettings.PlayersCount, uiElementsGenerator);
 }
Ejemplo n.º 4
0
 public UiGeneratorFactory(GameObject gameObject, IResourcesRepository resourcesRepository)
 {
     UiElementsGenerator = gameObject.AddComponent <UiElementsGenerator>();
     UiElementsGenerator.InitializeGenerator(resourcesRepository);
 }