Example #1
0
        public void HandleRollingAndSprinting(float delta)
        {
            if (animatorHandler.anim.GetBool("isInteracting"))
            {
                return;
            }

            if (inputHandler.rollFlag)
            {
                moveDirection  = cameraObject.forward * inputHandler.vertical;
                moveDirection += cameraObject.right * inputHandler.horizontal;

                if (inputHandler.moveAmount > 0)
                {
                    animatorHandler.PlayerTargetAnimation("Roll", true);
                    moveDirection.y = 0;
                    Quaternion rollRotation = Quaternion.LookRotation(moveDirection);
                    myTransform.rotation = rollRotation;
                }
                else
                {
                    animatorHandler.PlayerTargetAnimation("Backstep", true);
                }
            }
        }
Example #2
0
 public void TakeDamage(int damage)
 {
     currentHealth = currentHealth - damage;
     if (currentHealth > 0)
     {
         currentHealth = 0;
     }
     healthbar.SetCurrentHealth(currentHealth);
     if (currentHealth == 0)
     {
         currentHealth = 0;
         animatorHandler.PlayerTargetAnimation("Unarmed-Death1", true);
     }
     animatorHandler.PlayerTargetAnimation("Damage_Animation", true);
 }
Example #3
0
 public void HandleLightAttack(WeaponItem weapon)
 {
     animatorHandler.PlayerTargetAnimation(weapon.OH_Light_Attack_1, true);
 }