PlayerInventory.Update C# (CSharp) Method

Update() public method

public Update ( ) : void
return void
    void Update()
    {
        if (Input.GetKeyDown(inputManagerDatabase.CharacterSystemKeyCode))
        {
            if (!characterSystem.activeSelf)
            {
                characterSystemInventory.openInventory();
            }
            else
            {
                if (toolTip != null)
                    toolTip.deactivateTooltip();
                characterSystemInventory.closeInventory();
            }
        }

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

        if (Input.GetKeyDown(inputManagerDatabase.CraftSystemKeyCode))
        {
            if (!craftSystem.activeSelf)
                craftSystemInventory.openInventory();
            else
            {
                if (cS != null)
                    cS.backToInventory();
                if (toolTip != null)
                    toolTip.deactivateTooltip();
                craftSystemInventory.closeInventory();
            }
        }
    }

Usage Example

Ejemplo n.º 1
0
    void LateUpdate()
    {
        if (Input.GetKey(KeyCode.UpArrow))
        {
            weight += 1 * Time.deltaTime;
        }
        if (Input.GetKey(KeyCode.DownArrow))
        {
            weight -= 1 * Time.deltaTime;
        }
        if (Input.GetKey(KeyCode.Y))
        {
            x += 1;
        }
        if (Input.GetKey(KeyCode.U))
        {
            y += 1;
        }
        if (Input.GetKey(KeyCode.I))
        {
            z += 1;
        }

        if (Input.GetKey(KeyCode.H))
        {
            x -= 1;
        }
        if (Input.GetKey(KeyCode.J))
        {
            y -= 1;
        }
        if (Input.GetKey(KeyCode.K))
        {
            z -= 1;
        }
        if (Input.GetKey(KeyCode.P))
        {
            Debug.Log(weight);
        }
        ThisPlayer.Update();
        hotbar.Update();
        MyCamera.SetActive(true);
        localGUI.gameObject.SetActive(true);
        Vector3 Data = Player1Stats.GetData();

        StaminaBar.transform.localScale = new Vector3(Data.y / 100, 1, 1);
        HealthBar.transform.localScale  = new Vector3(Data.x / 100, 1, 1);
        SanityBar.transform.localScale  = new Vector3(Data.z / 100, 1, 1);
        ThisAudioManager.Update(100 - Data.z);
    }
All Usage Examples Of PlayerInventory::Update