void OnTriggerEnter(Collider otherColl)
 {
     if (otherColl.gameObject.tag == "EnemyShip")
     {
         tooClose = true;
         playerAI.SetObstacleDetected(otherColl.gameObject);
     }
 }
Exemplo n.º 2
0
 void OnTriggerEnter(Collider otherColl)
 {
     if (otherColl.gameObject.tag == "obstacle")
     {
         isObstacle = true;
         if (transform.parent.gameObject.tag == "EnemyShip")
         {
             enemyShipAI.SetObstacleDetected(otherColl.gameObject);
         }
         if (transform.parent.gameObject.tag == "PlayerShip")
         {
             playerShipAI.SetObstacleDetected(otherColl.gameObject);
         }
     }
 }