Beispiel #1
0
 void OnTriggerEnter(Collider collider)
 {
     if (collider.tag == "DeliveryPoint")
     {
         _inventoryScript.DeliverBox(collider.gameObject);
         _audioSource.PlayOneShot(_deliveryClip);
     }
     if (collider.tag == "EnemyPackage")
     {
         if (_inventoryScript.SocializerBoxes >= 10)
         {
             return;
         }
         _audioSource.PlayOneShot(_stealClip);
         _inventoryScript.AddBox(new DeliveryBox(DeliveryBox.BOXTYPE.KILLER, _inventoryScript._deliveryPointManager));
         Destroy(collider.gameObject);
     }
     if (collider.tag == "ExplorerArea")
     {
         Destroy(collider.gameObject);
         _inventoryScript._pointSystem.ExplorerPoints += 10f;
         _explorerPopup.SetActive(true);
         Invoke("DisableExplorerPopup", 3f);
     }
 }
Beispiel #2
0
 void OnTriggerEnter(Collider collider)
 {
     if (collider.tag == "DeliveryPoint")
     {
         _inventoryScript.DeliverBox(collider.gameObject);
     }
     if (collider.tag == "Bystander")
     {
         _inventoryScript.AddBox(new DeliveryBox(DeliveryBox.BOXTYPE.SOCIAL, _inventoryScript._deliveryPointManager));
         collider.gameObject.SetActive(false);
     }
     if (collider.tag == "EnemyPackage")
     {
         _inventoryScript.AddBox(new DeliveryBox(DeliveryBox.BOXTYPE.KILLER, _inventoryScript._deliveryPointManager));
         Destroy(collider.gameObject);
     }
 }