Inventory.openInventory C# (CSharp) Method

openInventory() public method

public openInventory ( ) : void
return void
    public void openInventory()
    {
        this.gameObject.SetActive(true);
        if (InventoryOpen != null)
            InventoryOpen();
    }

Usage Example

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(inputManagerDatabase.CharacterSystemKeyCode))
        {
            if (!characterSystem.activeSelf)
            {
                characterSystemInventory.openInventory();
                LockCameraAndShowMouse();
            }
            else
            {
                if (toolTip != null)
                {
                    toolTip.deactivateTooltip();
                }
                characterSystemInventory.closeInventory();
                UnlockCameraAndHideMouse();
            }
        }

        if (Input.GetKeyDown(inputManagerDatabase.InventoryKeyCode))
        {
            if (!inventory.activeSelf)
            {
                mainInventory.openInventory();
                LockCameraAndShowMouse();
            }
            else
            {
                if (toolTip != null)
                {
                    toolTip.deactivateTooltip();
                }
                mainInventory.closeInventory();
                UnlockCameraAndHideMouse();
            }
        }

        if (Input.GetKeyDown(inputManagerDatabase.CraftSystemKeyCode))
        {
            if (!craftSystem.activeSelf)
            {
                craftSystemInventory.openInventory();
                LockCameraAndShowMouse();
            }
            else
            {
                if (cS != null)
                {
                    cS.backToInventory();
                }
                if (toolTip != null)
                {
                    toolTip.deactivateTooltip();
                }
                craftSystemInventory.closeInventory();
                UnlockCameraAndHideMouse();
            }
        }
    }
All Usage Examples Of Inventory::openInventory