Esempio n. 1
0
 private void OnTriggerStay2D(Collider2D other)
 {
     if (!justAttacked && playerController.GetPlayerAttacking() && other.gameObject.tag == "Enemy") //if the player didn't just attack, is currently in the attack animation, and the object being attacked is tagged as "Enemy," the HurtEnemy logic is run
     {
         try                                                                                        //sloppily done just in case siphon isn't active on that specific character
         {
             if (siphon.GetIsSiphonActive())                                                        //checks if siphon was recently triggered
             {
                 successfulHit = true;                                                              //the hit was successfully made
             }
         }
         catch
         {
             //pass
         }
         other.gameObject.GetComponent <EnemyHealthManager>().HurtEnemy(damageToDeal);
         GameObject tempBurst = Instantiate(damageBurst, other.transform.position, other.transform.rotation);
         Destroy(tempBurst, 1.0f);
         justAttacked = true;
     }
 }