private void Slide() { if (_isJumping || _isSliding || _isBiting) { return; } _animator.SetTrigger("onBeginSlide"); wolfieState = WolfieState.Sliding; StartCoroutine(SlideEnumerator()); }
private void Bite() { if (_isJumping || _isSliding || _isBiting) { return; } wolfieState = WolfieState.Biting; _isBiting = true; StartCoroutine(_biteScript.Bite()); audioController.PlaySound(Sounds.BiteSound); }
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; }
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); }
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(); } }
private void OnFire() { wolfieState = WolfieState.OnFire; MainScript.Instance.GameOver(); audioController.PlaySound(Sounds.LossGameSound); }
private void OnJumpLanding() { _isJumping = false; _animator.SetBool("isJumping", false); wolfieState = WolfieState.Running; }
private void OnStopBiting() { _isBiting = false; wolfieState = WolfieState.Running; }