コード例 #1
0
 public InputSystem(IPlayerCamera camera,
                    NewWalkTargetSignal walkTargetSignal,
                    KeyPressedSignal keyPressedSignal,
                    TargetAquiredSignal targetAquiredSignal,
                    GameModel model
                    )
 {
     _playerCamera        = camera;
     _walkTargetSignal    = walkTargetSignal;
     _keyPressedSignal    = keyPressedSignal;
     _targetAquiredSignal = targetAquiredSignal;
     _model = model;
 }
コード例 #2
0
 private void Init(
     GameStartSignal startSignal,
     GameOverSignal gameOverSignal,
     TargetAquiredSignal targetAquiredSignal,
     ShowLootPickerSignal lootPickerSignal
     )
 {
     _targetAquiredSignal  = targetAquiredSignal;
     _gameStartSignal      = startSignal;
     _gameOverSignal       = gameOverSignal;
     _lootPickerSignal     = lootPickerSignal;
     _gameStartSignal     += ShowUI;
     _gameOverSignal      += HideUI;
     _targetAquiredSignal += UpdateEnemyHealthData;
     _lootPickerSignal    += ShowLootPicker;
 }
        void HandleTargetChanged(TargetAquiredSignal targetAquired)
        {
            var shouldFire = !targetAquired.TargetWasLost;

            if (shouldFire)
            {
                if (!_coroutine.IsValid)
                {
                    _coroutine = CreateCoroutine(StartFiringProjectiles());
                }
            }
            else
            {
                if (_coroutine.IsValid)
                {
                    _coroutine.Stop();
                    _coroutine = AdvancedCoroutine.Empty;
                }
            }
        }
コード例 #4
0
 void OnDestroy()
 {
     _gameStartSignal     -= ShowUI;
     _gameOverSignal      -= HideUI;
     _targetAquiredSignal -= UpdateEnemyHealthData;
 }
コード例 #5
0
 void HandleTargetChanged(TargetAquiredSignal message)
 {
     Target  = message.Target;
     enabled = message.Target != null;
 }
コード例 #6
0
 private void OnDestroy()
 {
     _targetAquireSignal -= Ability.Attack;
 }
コード例 #7
0
 private void Init(TargetAquiredSignal aquireSignal)
 {
     _targetAquireSignal  = aquireSignal;
     _targetAquireSignal += Ability.Attack;
 }
コード例 #8
0
 private void HandleTargetChanged(TargetAquiredSignal newTarget)
 {
     Target  = newTarget.Target;
     enabled = Target != null;
 }