/// <summary>
    /// Calls the inventory.
    /// </summary>
    /// <param name="b">If set to <c>true</c> b.</param>
    public void CallInventory(bool b)
    {
        if (!inventoryLocked)
        {
            inventoryUp = b;
            invControl.setInventoryState(b);
            inventoryOn = b;
            if (player.GetComponent <MouseLook> ().enabled&& inventoryUp)
            {
                changePlayerState(b);
            }
            if (!player.GetComponent <MouseLook> ().enabled&& !inventoryUp && !inventoryLocked && !tabletUp)
            {
                changePlayerState(b);
            }
        }

        if (map.activeSelf && inventoryUp)
        {
            map.GetComponent <MapController> ().CloseMap();
        }

        if (inventoryUp)
        {
            Cursor.visible    = true;
            Screen.lockCursor = false;
        }
        else if (!tabletUp && !map.activeSelf)
        {
            Cursor.visible    = false;
            Screen.lockCursor = true;
        }
    }
Example #2
0
    /// <summary>
    /// Calls the inventory.
    /// </summary>
    /// <param name="b">If set to <c>true</c> b.</param>
    public void CallInventory(bool b)
    {
        if (!inventoryLocked)
        {
            inventoryUp = b;
            invControl.setInventoryState(b);
            if (player.GetComponent <MouseLook> ().enabled&& inventoryUp)
            {
                changePlayerState();
            }
            if (!player.GetComponent <MouseLook> ().enabled&& !inventoryUp && !inventoryLocked && !tabletUp)
            {
                changePlayerState();
            }
        }

        if (map.activeSelf)
        {
            map.SetActive(false);
            mapUp = false;
        }

        if (inventoryUp)
        {
            Cursor.visible               = true;
            Screen.lockCursor            = false;
            locomotionCanvas.enabled     = false;
            dicaLocomotionCanvas.enabled = true;
        }
        else if (!tabletUp && !map.activeSelf)
        {
            Cursor.visible               = false;
            Screen.lockCursor            = true;
            locomotionCanvas.enabled     = true;
            dicaLocomotionCanvas.enabled = false;
        }
    }