private void OnTriggerExit(Collider other) { PlayerShipHitbox shipHitbox = other.GetComponent <PlayerShipHitbox>(); if (shipHitbox != null) { targetShip = null; } }
private void OnTriggerEnter(Collider other) { if (targetShip == null) { PlayerShipHitbox shipHitbox = other.GetComponent <PlayerShipHitbox>(); if (shipHitbox != null) { if (shipHitbox.GetRelatedShip as PlayerShip != null) { targetShip = shipHitbox.GetRelatedShip as PlayerShip; } } } }
void OnTriggerEnter(Collider other) { if (lootingPlayer != null) { return; } PlayerShipHitbox playerShipHitbox = other.GetComponent <PlayerShipHitbox>(); if (playerShipHitbox != null) { PlayerShip playerShip = playerShipHitbox.GetRelatedShip as PlayerShip; if (playerShip != null) { StartLootCrate(playerShip); } } }