Пример #1
0
    void Awake()
    {
        anim       = GetComponentInChildren <Animator>();
        enemyAudio = GetComponent <AudioSource>();
        //hitParticles = GetComponentInChildren<ParticleSystem>();
        capsuleCollider = GetComponent <CapsuleCollider>();
        enemyAI         = GetComponent <EnemyAI>();

        currentHealth = startingHealth;

        PopUpTextContollerScript.Initialize();
    }
Пример #2
0
    public void TakeDamage(int amount /*, Vector3 hitPoint*/)
    {
        if (isDead)
        {
            return;
        }
        else
        {
            enemyAudio.Play();

            currentHealth -= amount;

            PopUpTextContollerScript.CreateFloatingText(amount.ToString(), transform);

            if (currentHealth <= 0)
            {
                Death();
            }
        }
    }