public IEnumerator WaitForItemChange(InteractableObj _obj) { playerAnimator.SetBool("HoldingItem", false); yield return(new WaitForSeconds(1f)); playerAnimator.SetBool("HoldingItem", true); GetHandObject().SetActive(false); _obj.GetGameObj().SetActive(true); handObj = _obj; }
public IEnumerator BringUpInventoryItem(InteractableObj _obj) { handItemChanging = true; playerAnimator.SetBool("HoldingItem", false); yield return(new WaitForSeconds(1f)); playerAnimator.SetBool("HoldingItem", true); _obj.GetGameObj().SetActive(true); handObj = _obj; handItemChanging = false; }
//Mostly called from Raycaster after interact button clicked public void AddItem(ShopItem _item, InteractableObj _script) { GameObject newObj = GameObject.Instantiate(itemPrefab, _inventoryGrid.transform); StartCoroutine(WaitForHold(newObj)); _currentInv.Add(new InventoryItem(newObj, _item, _script.GetGameObj())); InventoryItemDisplay objDisplay = newObj.GetComponent <InventoryItemDisplay>(); objDisplay._master = this; objDisplay._data = _item; objDisplay.SetDisplay(_script); }
public GameObject GetHandObject() { return(handObj.GetGameObj()); }