Exemplo n.º 1
0
    private void KeyCtrl()
    {
        switch (playerNum)
        {
        case 1:
            if (Input.GetAxis("Horizontal") > 0)
            {
                myPlanet.PlanetRotate(Input.GetAxis("Horizontal"), 1);
                //d
            }
            else if (Input.GetAxis("Horizontal") < 0)
            {
                myPlanet.PlanetRotate(Input.GetAxis("Horizontal"), -1);
                //a
            }
            if (Input.GetButtonDown("Fire1"))
            {
                myPlanet.Fire(false);
            }
            break;

        case 2:
            if (Input.GetAxis("Horizontal2") > 0)
            {
                myPlanet.PlanetRotate(Input.GetAxis("Horizontal2"), 1);
            }
            else if (Input.GetAxis("Horizontal2") < 0)
            {
                myPlanet.PlanetRotate(Input.GetAxis("Horizontal2"), -1);
            }
            if (Input.GetButtonDown("Fire2"))
            {
                myPlanet.Fire(false);
            }
            break;
        }
    }