Esempio n. 1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("Player") && !playerHit)
     {
         playerHit = true;
         PlayerHealth playerHealth = other.GetComponent <PlayerHealth>();
         playerHealth.TakeDamage(damage);
         playerHealth.ApplyDoTEffect(new DoTEffect(12.6f, 2.5f, 8.0f));
     }
 }
Esempio n. 2
0
    void OnTriggerEnter(Collider other)
    {
        if (other.tag.Equals("Weapon"))
        {
            Sword sword = other.GetComponent <Sword>();
            if (sword != null && sword.IsBlocking())
            {
                OnAttackBlock();
                return;
            }
        }

        if (!other.tag.Equals("Player") || maxHitCount <= 0)
        {
            return;
        }

        maxHitCount--;
        PlayerHealth playerHealth = other.GetComponent <PlayerHealth>();

        playerHealth.TakeDamage(damage);
        playerHealth.ApplyDoTEffect(new DoTEffect(20.1f, 4.0f, 5.0f));
        playerHit = true;
    }