Beispiel #1
0
        public void TakeDamage(int damage)
        {
            currentHealth = currentHealth - damage;
            healthBar.SetCurrentHealth(currentHealth);
            animatorHandler.PlayTargetAnimation("Damage01", true);

            if (currentHealth <= 0)
            {
                currentHealth = 0;
                animatorHandler.PlayTargetAnimation("Death01", true);
            }
        }
        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.PlayTargetAnimation("Rolling", true);
                    moveDirection.y = 0;

                    Quaternion rollRotation = Quaternion.LookRotation(moveDirection);
                    myTransform.rotation = rollRotation;
                }
                else
                {
                    animatorHandler.PlayTargetAnimation("Backstep", true);
                }
            }
        }
 public void HandleLightAttack(WeaponItem weapon)
 {
     weaponSlotManager.attackingWeapon = weapon;
     animatorHandler.PlayTargetAnimation(weapon.oneHandedLightAttack1, true);
     lastAttack = weapon.oneHandedLightAttack1;
 }