Example #1
0
 /// <summary>
 /// Check if the item is pickable and if yes, proceeds with triggering the effects and disabling the object
 /// </summary>
 public virtual void PickItem(GameObject picker)
 {
     if (CheckIfPickable())
     {
         Effects();
         PickableItemEvent.Trigger(this);
         Pick();
         if (DisableObjectOnPick)
         {
             // we desactivate the gameobject
             gameObject.SetActive(false);
         }
         else
         {
             if (DisableColliderOnPick)
             {
                 _collider.enabled = false;
             }
             if (DisableRendererOnPick && (_renderer != null))
             {
                 _renderer.enabled = false;
             }
         }
     }
 }
Example #2
0
 public virtual void OnMMEvent(PickableItemEvent pickableItemEvent)
 {
     if (pickableItemEvent.PickedItem != null)
     {
         if (pickableItemEvent.PickedItem.GetComponent <Coin>() != null)
         {
             MMAchievementManager.AddProgress("MoneyMoneyMoney", 1);
         }
         if (pickableItemEvent.PickedItem.GetComponent <Stimpack>() != null)
         {
             MMAchievementManager.UnlockAchievement("Medic");
         }
     }
 }
Example #3
0
 /// <summary>
 /// Check if the item is pickable and if yes, proceeds with triggering the effects and disabling the object
 /// </summary>
 public virtual void PickItem()
 {
     if (CheckIfPickable())
     {
         Effects();
         PickableItemEvent.Trigger(this);
         Pick();
         if (DisableObjectOnPick)
         {
             // we desactivate the gameobject
             gameObject.SetActive(false);
         }
     }
 }