Ejemplo n.º 1
0
    void PowerController()
    {
        #region PowerSwitch
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            if (m_pManager.CountList > 0)
            {
                UI.playWindow.leftInfo(m_pManager.PickedValue(0));
            }
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            if (m_pManager.CountList > 1)
            {
                UI.playWindow.rightInfo(m_pManager.PickedValue(1));
            }
        }
        else if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            //ändra positiv/negativ på 1/2
        }
        else if (Input.GetKeyDown(KeyCode.Alpha4))
        {
            if (!m_pManager.PowerIsActive)
            {
                m_pManager.UndoItem();
                ResetTagInfo(false);
            }
            // Ångra första obj och lägg till andra på nästkommande plats
        }

        if (!GetComponent <HandProperties>().objektLifted)
        {
            if (Input.GetAxis("Mouse ScrollWheel") > 0)
            {
                m_pManager.ChangePower(1);
            }
            else if (Input.GetAxis("Mouse ScrollWheel") < 0)
            {
                m_pManager.ChangePower(-1);
            }
        }


        #endregion

        if (Input.GetKeyDown(KeyCode.E))
        {
            if (grabHit(6f))
            {
                m_pManager.addItem(m_currentPickupObj.gameObject);
            }
        }
        #region HaveItems
        if (m_pManager.HaveItems)
        {
            if (Input.GetKeyDown(KeyCode.Q))
            {
                if (m_pManager.PowerIsActive)
                {
                    m_pManager.PowerStep(-1);
                }
                else if (m_pManager.HaveItems)
                {
                    m_pManager.popItem();
                    ResetTagInfo(false);
                }
            }
            else if (Input.GetKeyDown(KeyCode.T))
            {
            }
            else if (Input.GetKeyDown(KeyCode.F))
            {
                if (!m_pManager.PowerIsActive)
                {
                    m_pManager.UsePower();
                    ResetTagInfo(true);
                }
                else
                {
                    m_pManager.PowerStep(1);
                }
            }
        }


        #endregion
    }