Beispiel #1
0
    void ZombieButton()
    {
        switch (m_job)
        {
        case PlayerJob.GeroZomie:
            if (m_playerInput.button_A && !m_jump)
            {
                m_rigid2D.AddForce(Vector2.up * m_flap);
                m_playerAnimations.JumpAnimation();
                m_jump = true;
            }

            if (m_playerInput.button_B)
            {
                if (m_ShotSoul)
                {
                    Instantiate(m_Soul, transform.position, transform.rotation);
                }
                m_ShotSoul = false;
            }

            if (m_playerInput.button_X)
            {
                m_playerAnimations.GeroAnimation();
                this.gameObject.GetComponent <ZombieController>().AttackCoal1();
            }

            if (m_playerInput.button_Y)
            {
                m_playerAnimations.AtteckAnimation();
            }
            break;

        case PlayerJob.Dogzombie:
            if (m_playerInput.button_A && !m_jump)
            {
                m_rigid2D.AddForce(Vector2.up * m_flap);
                m_playerAnimations.JumpAnimation();
                m_jump = true;
            }
            if (m_playerInput.button_B)
            {
                if (m_ShotSoul)
                {
                    Instantiate(m_Soul, transform.position, transform.rotation);
                }
                m_ShotSoul = false;
            }

            if (m_playerInput.button_X)
            {
                //this.gameObject.GetComponent<ZombieController>().AttackCoal1();
            }

            if (m_playerInput.button_Y)
            {
                //m_playerAnimations.AtteckAnimation();
            }
            break;

        case PlayerJob.PowerZombie:
            if (m_playerInput.button_A && !m_jump)
            {
                /*
                 * m_rigid2D.AddForce(Vector2.up * m_flap);
                 * m_playerAnimations.JumpAnimation();
                 * m_jump = true;
                 */
            }
            if (m_playerInput.button_B)
            {
                if (m_ShotSoul)
                {
                    Instantiate(m_Soul, transform.position, transform.rotation);
                }
                m_ShotSoul = false;
            }

            if (m_playerInput.button_X)
            {
                Debug.Log("tak");
                m_playerAnimations.TackleAnimation();
                this.gameObject.GetComponent <ZombieController>().AttackCoal1();
            }

            if (m_playerInput.button_Y)
            {
                m_playerAnimations.AtteckAnimation();
            }
            break;

        case PlayerJob.BirdZombie:
            if (m_playerInput.button_A && !m_jump)
            {
                m_rigid2D.AddForce(Vector2.up * m_flap);
                m_playerAnimations.JumpAnimation();
                m_jump = true;
            }
            if (m_playerInput.button_B)
            {
                Debug.Log("a");
                if (m_ShotSoul)
                {
                    Instantiate(m_Soul, transform.position, transform.rotation);
                }
                m_ShotSoul = false;
            }

            if (m_playerInput.button_X)
            {
                m_rigid2D.AddForce(Vector2.up * 10f);
                m_playerAnimations.FlyAnimation();
            }

            if (m_playerInput.button_Y)
            {
                m_playerAnimations.AtteckAnimation();
            }
            break;

        default:
            break;
        }
    }