Пример #1
0
    private void OnTriggerExit(Collider other)
    {
        PlayerShipHitbox shipHitbox = other.GetComponent <PlayerShipHitbox>();

        if (shipHitbox != null)
        {
            targetShip = null;
        }
    }
Пример #2
0
 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;
             }
         }
     }
 }
Пример #3
0
    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);
            }
        }
    }