Exemple #1
0
    public void CarDirectControl()
    {
        carOrbit = (CarOrbit)FindObjectOfType(typeof(CarOrbit));
        int direct = carOrbit.direction;

        if (direct == -1)
        {
            //set direction to 1
            carOrbit.direction = 1;
        }
        else if (direct == 1)
        {
            //set direction to -1
            carOrbit.direction = -1;
        }
        var rotationVector = car.transform.rotation.eulerAngles;

        rotationVector.y       = rotationVector.y - 185;
        car.transform.rotation = Quaternion.Euler(rotationVector);
    }
Exemple #2
0
 public void CarSpeedControl(float num)
 {
     carOrbit = (CarOrbit)FindObjectOfType(typeof(CarOrbit));
     carOrbit.rotationSpeed = (int)num;
 }