Beispiel #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;
    }
Beispiel #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;
    }
Beispiel #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);
    }
Beispiel #4
0
 public GameObject GetHandObject()
 {
     return(handObj.GetGameObj());
 }