Ejemplo n.º 1
0
 void OnCollisionEnter2D(Collision2D col)
 {
     //there is a new collision, we must notify the gameManager
     _pool.ReturnItem(this.gameObject);                                             //we return the plane to the pool
     col.transform.GetComponentInParent <PoolManager>().ReturnItem(col.gameObject); //we return the bullet to the pool
     _generator.PlaneDestroyed();                                                   //we notify the generator that the plane is destroyed
 }