// OnTriggerExit: Asteroids, Bullets and PickableItems will be destroid. // SpaceShip will be destroid if it's ouside (means that there is another spaceship inside) // Spaceship will not be destroid if it's inside play area (SpaceShip can rotate while colliding) public void OnTriggerExit(Collider other) { cyclicObj = other.gameObject.GetComponent <CyclicMoveable>(); if (cyclicObj) { HandleExitCyclic(cyclicObj); return; } bullet = other.gameObject.GetComponent <Bullet>(); if (bullet && IsPosOutsideScreen(bullet.transform.position)) { bullet.Selfdestruct(); return; } pickable = other.gameObject.GetComponent <PickableItem>(); if (pickable && IsPosOutsideScreen(pickable.transform.position)) { pickable.Selfdestruct(); } }