Beispiel #1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (tagsToBeDestroyedBy.Contains(other.tag))
     {
         if (explosion != null)
         {
             Instantiate(explosion, transform.position, transform.rotation);
         }
         if (_registerDeath != null)
         {
             _registerDeath.DestroyedOnImpact(gameObject.tag);
         }
         Destroy(gameObject);
     }
 }
Beispiel #2
0
 public void DestroyedOnImpact(string tag)
 {
     _registerDeath.DestroyedOnImpact(tag);
 }