Beispiel #1
0
    public void GetDamage(float amount)
    {
        health -= amount;
        healthBarSystem.Hit();
        healthBarSystem.SetHelthValue(health);

        //Slow down
        if (enemyType != EnemyType.Giant && !isIceBlock)
        {
            speed         *= 0.75f;
            agent.speed    = speed;
            animator.speed = speed;
            animator.SetBool("hit", true);
            animator.SetBool("bodyshot", true);
        }
        //Plat slow animation
    }
 IEnumerator GetDamageSeq(float amount)
 {
     currentHealth -= amount;
     healthBarSystem.Hit();
     healthBarSystem.SetHelthValue(currentHealth);
     //Hit animation
     yield return(new WaitForSeconds(1));
 }