Beispiel #1
0
    //setando interações dos colisores
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.name == "FUNDO")
        {
            Destroy(gameObject);
        }

        if (other.gameObject.name == "Noire")
        {
            Destroy(gameObject);
            aliceHP.TakeDamage(2);
        }
    }
Beispiel #2
0
 //Controla as interações entre os colliders
 void OnCollisionEnter2D(Collision2D coll)
 {
     //se os tiros pegam no cenario eles são destruidos,
     if (coll.gameObject.name == "FUNDO" | coll.gameObject.name == "Plataforma" | coll.gameObject.name == "Plataforma (1)" | coll.gameObject.name == "Plataforma (2)" | coll.gameObject.name == "Plataforma (3)")
     {
         Destroy(gameObject);
     }
     //se atingem o chefe eles dão dano
     if (coll.gameObject.name == "Alice")
     {
         Destroy(gameObject);
         aliceHP.TakeDamage(2);
     }
     //se atingem tiros do chefe eles se auto destroem junto com o tiro do chefe (a segunda parte eh setada na clase do tiro do chefe)
     if (coll.gameObject.name == "ShotAlice2(Clone)" | coll.gameObject.name == "ShotAlice3(Clone)")
     {
         Destroy(gameObject);
     }
 }