public void ShutDown()
    {
        LEInventory inventory = transform.root.GetComponentInChildren <LEInventory>();

        inventory.AddToGUI(handle.item);
        transform.SetParent(inventory.transform);
        transform.gameObject.SetActive(false);
    }
 public void ItemOnGUIDoubleClick(ItemHandleOnGUI guiObj)
 {
     if (GameCentalPr.Instance.PlayerProcessor.AddHealth(addHealth))
     {
         guiObj.Clean();
         LEInventory inventory = GetComponent <LEInventory>();
         Item        item      = GetComponentInChildren <ItemHandleOnObj>().item;
         inventory.RemoveItem(item);
         DestroyImmediate(gameObject);
     }
 }
Exemplo n.º 3
0
    public void ReloadItemInfoFromSave(Item _item, LEInventory inventory)
    {
        isInit = true;
        item   = _item;

        //Add GUI Double Click callback to
        ItemOnGUIDoubleClickable iGUIDoubleClickable = GetComponentInParent <ItemOnGUIDoubleClickable>();

        if (iGUIDoubleClickable != null)
        {
            //item.OnGUIDoubleClick will be call when we double click the GUI on inventory
            item.OnGUIDoubleClick = iGUIDoubleClickable.ItemOnGUIDoubleClick;
        }

        inventory.AddItem(item);
        transform.parent.parent = inventory.transform;
        transform.parent.gameObject.SetActive(false);
    }
Exemplo n.º 4
0
    //Picke Upable Object. When we double click on the object in the scene.
    private void OnMouseDown()
    {
        if (!clickManager.DoubleClick())
        {
            return;
        }

        if (!isInit)
        {
            FetchItemInfo();
        }

        //Find Player and Players inventory
        TargetLE    lplayer   = FindObjectOfType <TargetLE>();
        LEInventory inventory = lplayer.transform.GetComponentInChildren <LEInventory>();

        inventory.AddItem(item);
        transform.parent.parent = inventory.transform;
        transform.parent.gameObject.SetActive(false);
        CursorManager.GetInstance().setMouse();
    }