private void MoveStateChangeHandler(ICanChangeMoveState moveState, MovingEventArgs eventArgs)
 {
     if (eventArgs.currentMovingState == MovingState.Move &&
         _fSM.GetCurrentAnimation().name == PlayerFSMData.Anim.Run_Ground)
     {
         _particles["Run_Ground"].Play();
         _repeatFootstepSFX = true;
     }
     else
     {
         _particles["Run_Ground"].Stop();
         _repeatFootstepSFX = false;
     }
     if (eventArgs.currentMovingState == MovingState.Airborne)
     {
         _particles["Jump_In_Air"].Play();
         int    i = Random.Range(0, 4);
         string j = i.ToString();
         _playerAudioSource.clip   = _audios["Jump" + j];
         _playerAudioSource.volume = _volume["Jump" + j];
         _playerAudioSource.pitch  = _pitch["Jump" + j];
         _playerAudioSource.Play();
     }
     if (eventArgs.currentMovingState == MovingState.Dash)
     {
         _playerAudioSource.clip   = _audios["Dash"];
         _playerAudioSource.volume = _volume["Dash"];
         _playerAudioSource.pitch  = _pitch["Dash"];
         _playerAudioSource.Play();
     }
 }
Beispiel #2
0
 private void HandleMovingStateChanged(ICanChangeMoveState sender, MovingEventArgs eventArgs)
 {
     if (eventArgs.lastMovingState == MovingState.Dash)
     {
         _animator.SetToggle(PlayerFSMData.Stat.DashEnd, true);
     }
 }