Beispiel #1
0
    public void OnOpenInventory()
    {
        bool newState = !MainControllerManager.InUI;

        this.inventoryGUI.SetActive(newState);
        MainControllerManager.InUI = newState;

        if (newState)
        {
            invUIPlayer.ReloadInventory();
        }

        this.invUIPlayer.ResetSelection();
        hotbar.SetActive(!newState);
        MouseLook.ToggleMouseCursor(newState);

        // If closing, refresh the hotbar
        if (newState == false)
        {
            playerEvents.DrawHotbar();
            playerEvents.DrawItemEntity(playerEvents.GetSlotStack());
        }
    }