Exemplo n.º 1
0
    private void SwitchElementListener()
    {
        //If left shift is held, return out because left shift + 1-6 uses item instead
        if (Input.GetKey(KeyCode.LeftShift))
        {
            return;
        }

        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            m_playerStats.ActivateElement(Elements.Fire);
            UpdateElementProjectile();
            UpdateElementSpell();
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            m_playerStats.ActivateElement(Elements.Water);
            UpdateElementProjectile();
            UpdateElementSpell();
        }
        else if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            m_playerStats.ActivateElement(Elements.Earth);
            UpdateElementProjectile();
            UpdateElementSpell();
        }
        else if (Input.GetKeyDown(KeyCode.Alpha4))
        {
            m_playerStats.ActivateElement(Elements.Nature);
            UpdateElementProjectile();
            UpdateElementSpell();
        }
        else if (Input.GetKeyDown(KeyCode.Alpha5))
        {
            m_playerStats.ActivateElement(Elements.Air);
            UpdateElementProjectile();
            UpdateElementSpell();
        }
    }