예제 #1
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     Debug.Log("Triggered");
     if (other.gameObject.tag == "Loot")
     {
         Debug.Log("pickup loot!!!");
         Loot_phys theLoot = other.GetComponent(typeof(Loot_phys)) as Loot_phys;
         backpack += theLoot.value;
         theLoot.PickedUp();
     }
 }
 private void OnTriggerEnter2D(Collider2D other)
 {
     Debug.Log("Triggered");
     if (other.gameObject.tag == "Loot")
     {
         Loot_phys theLoot = other.GetComponent(typeof(Loot_phys)) as Loot_phys;
         if (theLoot.IsResting())
         {
             // Blast( Vector3.right, 10 )
             gameController.ApplyPickup(theLoot.value);
             theLoot.PickedUp();
         }
         // Debug.Log("pickup loot!!!");
     }
 }