Ejemplo n.º 1
0
    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;
    }
Ejemplo n.º 2
0
    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;
    }
Ejemplo n.º 3
0
    //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);
    }
Ejemplo n.º 4
0
 public GameObject GetHandObject()
 {
     return(handObj.GetGameObj());
 }