Exemple #1
0
        public void PostConstruct(params object[] args)
        {
            _highestRunScore.LoadHighScoreFromDisk(GameConstants.PlayerData.HighScore);

            _gameEventManager.Subscribe(GameEvents.Gameplay.Start, OnGameStart);
            _gameEventManager.Subscribe(GameEvents.Obstacle.Crossed, OnCrossedObstacle);
            _gameEventManager.Subscribe(GameEvents.Powerup.Pickup, OnPowerupPickup);
            _gameEventManager.Subscribe(GameEvents.Gameplay.Stop, OnLevelStop);
        }
        public void PostConstruct(params object[] args)
        {
            _gameEventManager.Subscribe(GameEvents.Time.OverrideScale, OnTimeScaleOverride);
            _gameEventManager.Subscribe(GameEvents.Time.IncrementScale, OnIncrementScale);
            _gameEventManager.Subscribe(GameEvents.Time.DecrementScale, OnDecrementScale);

            _gameEventManager.Subscribe(GameEvents.Gameplay.Start, OnReset);
            _gameEventManager.Subscribe(GameEvents.Gameplay.Reset, OnReset);
        }
        public void PostConstruct(params object[] args)
        {
            if (GetManagedObjects())
            {
                _gameEventManager.Subscribe(GameEvents.Gameplay.Start, OnGameStart);
                _gameEventManager.Subscribe(GameEvents.Gameplay.Stop, OnGameStop);
                return;
            }

            Debug.LogError($"[{nameof(CollisionController)}] Cannot find references");
        }
        public void PostConstruct(params object[] args)
        {
            if (GetReferences())
            {
                _gameEventManager.Subscribe(GameEvents.StateMachineEvents.Start, OnGameStateStart);
                _gameEventManager.Subscribe(GameEvents.StateMachineEvents.End, OnGameStateEnd);
                return;
            }

            Debug.LogError($"[{nameof(UiServiceController)}] {nameof(PostConstruct)} Failed to find references!");
        }
        public void PostConstruct(params object[] args)
        {
            _input = new UnityInput();

            GameInput = new GameInputAdapter(_input.Game);
            UiInput   = new UiInputAdapter(_input.UI);

            UiInput.SetEnabled(false);
            GameInput.SetEnabled(false);

            _gameEventManager.Subscribe(GameEvents.StateMachineEvents.Start, OnGameStateStart);
            _gameEventManager.Subscribe(GameEvents.StateMachineEvents.End, OnGameStateEnd);
        }
        public override void PostConstruct(params object[] args)
        {
            base.PostConstruct(args);

            _gameEventManager.Subscribe(GameEvents.Gameplay.Start, OnGameStart);
        }
Exemple #7
0
 protected void StartWait(Action <IInitializable> onComplete)
 {
     _onComplete = onComplete;
     _gameEventManager.Subscribe(EndEvent, OnWaitComplete);
 }
 public void PostConstruct(params object[] args)
 {
     _gameEventManager.Subscribe(GameEvents.Application.Share, OnShare);
     _gameEventManager.Subscribe(GameEvents.Application.Contact, OnContact);
 }
Exemple #9
0
 public void PostConstruct(params object[] args)
 {
     _gameEventManager.Subscribe(GameEvents.Gameplay.Start, OnGameStart);
     _gameEventManager.Subscribe(GameEvents.Gameplay.Start, OnGameEnd);
     _gameEventManager.Subscribe(GameEvents.Powerup.Pickup, OnPowerupCollected);
 }
 public void PostConstruct(params object[] args)
 {
     _gameEventManager.Subscribe(GameEvents.Gameplay.Start, OnGameStart);
 }