Beispiel #1
0
 private void Slide()
 {
     if (_isJumping || _isSliding || _isBiting)
     {
         return;
     }
     _animator.SetTrigger("onBeginSlide");
     wolfieState = WolfieState.Sliding;
     StartCoroutine(SlideEnumerator());
 }
Beispiel #2
0
 private void Bite()
 {
     if (_isJumping || _isSliding || _isBiting)
     {
         return;
     }
     wolfieState = WolfieState.Biting;
     _isBiting   = true;
     StartCoroutine(_biteScript.Bite());
     audioController.PlaySound(Sounds.BiteSound);
 }
Beispiel #3
0
        private IEnumerator SlideEnumerator()
        {
            _isSliding = true;
            _animator.SetBool("isSliding", true);
            audioController.PlaySound(Sounds.SlideSound);
            physicsController.SlideBegin();
            yield return(new WaitForSeconds(maxSlideTime));

            physicsController.SlideEnd();
            _animator.SetBool("isSliding", false);
            wolfieState = WolfieState.Running;
            _isSliding  = false;
        }
Beispiel #4
0
 private void Jump()
 {
     if (_isJumping || _isSliding || _isBiting)
     {
         return;
     }
     _animator.SetTrigger("takeOff");
     wolfieState = WolfieState.Jumping;
     physicsController.Jump();
     audioController.PlaySound(Sounds.JumpSound);
     _isJumping = true;
     _animator.SetBool("isJumping", true);
 }
Beispiel #5
0
 private void ObstacleHit()
 {
     if (_shieldCharges > 0)
     {
         _shieldCharges -= 1;
         MainScript.Instance.UpdateShieldPowerUpState(_shieldCharges);
         MainScript.Instance.obstaclesInScene.RemoveAt(0);
     }
     else
     {
         if (_isSliding || _isBiting || _isJumping)
         {
             StopAllCoroutines();
         }
         wolfieState = WolfieState.Stunned;
         physicsController.GetStunned();
     }
 }
Beispiel #6
0
 private void OnFire()
 {
     wolfieState = WolfieState.OnFire;
     MainScript.Instance.GameOver();
     audioController.PlaySound(Sounds.LossGameSound);
 }
Beispiel #7
0
 private void OnJumpLanding()
 {
     _isJumping = false;
     _animator.SetBool("isJumping", false);
     wolfieState = WolfieState.Running;
 }
Beispiel #8
0
 private void OnStopBiting()
 {
     _isBiting   = false;
     wolfieState = WolfieState.Running;
 }