Beispiel #1
0
    //If item is stackable then change text to match Ammout
    //Change in future to update on a function call, update is super ineffecient
    void Update()
    {
        if (_Item.Stackable)
        {
            this.transform.GetChild(0).GetComponent <Text>().text = Ammout.ToString();
        }

        //Cleanly closes inv if I was pressed
        if (Input.GetKeyDown(KeyCode.I))
        {
            if (_mouseOver)
            {
                _mouseOver = false;
                tooltip.Deactivate();
            }
            _canDrag = false;
            _canDrop = false;
            this.transform.SetParent(InventoryMgr.InvSlots[InvSlotID].transform);
            this.transform.position = InventoryMgr.InvSlots[InvSlotID].transform.position;
            GetComponent <CanvasGroup>().blocksRaycasts = true;
        }
    }
Beispiel #2
0
 //disables tooltip info for item
 public void OnPointerExit(PointerEventData eventData)
 {
     tooltip.Deactivate();
 }