Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        UpdateSlots();

        if (Input.GetKeyDown((KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("DisplayInvetoryButton"))))
        {
            if (image)
            {
                image.enabled = !image.enabled;
                mouse.GetComponent <MouseCursor>().SetVisibleCursor(image.enabled);
            }

            foreach (Transform g in this.transform.GetComponentsInChildren <Transform>(true))
            {
                if (g.name != "InventoryScreen")
                {
                    g.gameObject.SetActive(image.enabled);
                }
            }
        }

        //TODO: METHOD RESPONSIBLE FOR REWARDS FROM CHEST, FIND A BETTER PLACE FOR IT DURING REFACTOR
        if (Statics.chestOpened && !Statics.itemDropped)
        {
            inventory.GenerateNumberOfItemsFromChest(3);
            Statics.itemDropped = true;
        }
    }