private void OnGUI()
    {
        //JUST FOR DEBUGGING PURPOSES

        if (mouseOver)
        {
            //ItemInfo.OpenInfo(item);
        }
        else
        {
            ItemInfo.CloseInfo();
        }
    }
    } // NEEDS TO BE RECONFIGURED IF ITEM DB IS CHANGED!!

    public void CheckInput(PlayerEquipmentSlot slot, InventoryItem item)
    {
        if (item != null)
        {
            if (Input.GetMouseButtonDown(1)) //RightClick
            {
                //Debug.Log("RightClicked on: " + item.itemName + " in your equipment.");
                if (ItemInfo.GetItemInfoActive())
                {
                    ItemInfo.CloseInfo();
                }
                //if (PlayerBehaviour.Player._PlayerInventory.AddItem(item))
                //{
                //    slot.Reset();
                //}
            }
        }
    }
    private void Pickup(Collider other)
    {
        if (other.tag == "ItemRepresentation")
        {
            //ItemRepresentation tempItemRep = other.GetComponent<ItemRepresentation>();

            ItemInfo.CloseInfo();

            //if (PlayerBehaviour.Player._PlayerInventory.AddItem(tempItemRep.Item))
            //{
            //    //Debug.Log("Returned True and now Destroy");
            //    Destroy(other.gameObject);
            //}
            //else
            //{
            //    other.GetComponent<Rigidbody>().AddForce(PlayerBehaviour.Player.transform.forward * 5, ForceMode.Impulse);
            //}
        }
    }
示例#4
0
 /// <summary>
 /// Check Input if we should use the item.
 /// </summary>
 /// <param name="slot"></param>
 /// <param name="item"></param>
 public void CheckInput(PlayerInventorySlot slot, InventoryItem item)
 {
     if (item != null)
     {
         if (Input.GetButtonDown("XboxA"))
         {
             //USE ITEM / EQUIP ITEM
             if (ItemInfo.GetItemInfoActive())
             {
                 ItemInfo.CloseInfo();
             }
             UseItem(slot, item);
         }
         if (Input.GetButtonDown("XboxX"))
         {
             //USE ITEM / EQUIP ITEM
             if (ItemInfo.GetItemInfoActive())
             {
                 ItemInfo.CloseInfo();
             }
             RemoveItem(slot, item); //SHOULD BE CHANGED TO DISMANTLE METHOD AND GET SOMETHING FOR DISMANTLING ITEM.
         }
     }
 }
 public void OnMouseExit()
 {
     //Debug.Log("Reticle Exit: " + this.name);
     ItemInfo.CloseInfo();
 }