Exemplo n.º 1
0
 private void OnTriggerExit2D(Collider2D other)
 {
     if (other.tag == ("Player"))
     {
         PlatformerCharacter2D player = other.GetComponent <PlatformerCharacter2D>();
         player.TakeHp(1000);
     }
     else if (other.tag == "Spells")
     {
         Destroy(other.gameObject);
     }
 }
Exemplo n.º 2
0
        private void OnCollisionEnter2D(Collision2D other)
        {
            PlatformerCharacter2D player = other.collider.GetComponent <PlatformerCharacter2D>();

            if (GetComponent <Spell_2>().NumberOfPlayer != player.GetComponent <PlatformerCharacter2D>().NumberOfPlayer)
            {
                player.TakeHp(Demage);
            }
            if (GetComponent <Spell_2>().NumberOfPlayer == player.GetComponent <PlatformerCharacter2D>().NumberOfPlayer)
            {
                Physics2D.IgnoreCollision(other.collider, GetComponent <Collider2D>(), true);
            }
        }
Exemplo n.º 3
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == ("Platform"))
     {
         Destroy(gameObject);
     }
     else if (other.tag == ("Player"))
     {
         PlatformerCharacter2D player = other.GetComponent <PlatformerCharacter2D>();
         if (GetComponent <Spell1>().NumberOfPlayer != player.GetComponent <PlatformerCharacter2D>().NumberOfPlayer)
         {
             player.TakeHp(Demage);
             Destroy(gameObject);
         }
     }
 }