Пример #1
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);
        }
Пример #2
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();
        }