Ejemplo n.º 1
0
    void FixedUpdate()
    {
        h = Input.GetAxis(Horizontal_KEY);

        accel     = brake = Input.GetAxis(Vertical_KEY);
        handbrake = Input.GetAxis(HANDBRAKE_KEY);

        m_Car.Move(h, accel, brake, handbrake); // pass the input to the car!
        activeNitro = Input.GetButton(NITRO_KEY);
        m_Car.nitro(activeNitro);
    }
Ejemplo n.º 2
0
    void FixedUpdate()
    {
        // h =  Input.GetAxis(Horizontal_KEY) ;
        h = Input.GetAxis("Mouse X");

        // accel = brake = Input.GetAxis(Vertical_KEY) ;
        accel = brake = Input.GetAxis("Mouse Y");

        if (Input.touchCount > 0)
        {
            h     = Input.touches[0].deltaPosition.x;
            accel = brake = Input.touches[0].deltaPosition.y;
        }

        handbrake = Input.GetAxis(HANDBRAKE_KEY);

        m_Car.Move(h, accel, brake, handbrake); // pass the input to the car!
        activeNitro = Input.GetButton(NITRO_KEY);
        m_Car.nitro(activeNitro);
    }