Ejemplo n.º 1
0
 public override void OnExecute(TriggerAction.TYPE action)
 {
     base.OnExecute(action);
     if (action == TriggerAction.TYPE.Insert)
     {
         Item currentItem = Player.Get().GetCurrentItem(Hand.Right);
         if (currentItem && this.m_ItemID == currentItem.GetInfoID() && currentItem.m_Info.IsHeavyObject())
         {
             HeavyObject heavyObject = (HeavyObject)currentItem;
             if (heavyObject.m_Attached.Count > 0)
             {
                 this.Fulfill(false);
                 heavyObject.DetachHeavyObject(0, true);
                 return;
             }
             HeavyObjectController.Get().InsertToGhostSlot(this);
             return;
         }
         else
         {
             this.Fulfill(false);
             InventoryBackpack.Get().RemoveItem(this.m_ItemID, 1);
         }
     }
 }
Ejemplo n.º 2
0
    private void RemoveItemFromHand()
    {
        HeavyObject heavyObject = (HeavyObject)Player.Get().GetCurrentItem(Hand.Right);

        if (heavyObject.m_Attached.Count > 0)
        {
            heavyObject.DetachHeavyObject(heavyObject.m_Attached.Count - 1, true);
            return;
        }
        Player.Get().DropItem(heavyObject);
        UnityEngine.Object.Destroy(heavyObject.gameObject);
    }