fix errors
This commit is contained in:
@@ -17,8 +17,6 @@ public class GameController :MonoBehaviour
|
||||
public static bool RaceIsStarted { get { return true; } }
|
||||
public static bool RaceIsEnded { get { return false; } }
|
||||
|
||||
public TextMeshPro speedometer;
|
||||
|
||||
public List<GameObject> cars;
|
||||
int CurrentCarIndex = 0;
|
||||
|
||||
@@ -29,14 +27,7 @@ public class GameController :MonoBehaviour
|
||||
{
|
||||
finished=gameObject.GetComponent<GameManager>().playersFinished;
|
||||
|
||||
if (speedometer == null)
|
||||
{
|
||||
speedometer = new TextMeshPro();
|
||||
}
|
||||
if (carRB == null)
|
||||
{
|
||||
carRB = GetComponent<Rigidbody>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Update ()
|
||||
@@ -47,9 +38,7 @@ public class GameController :MonoBehaviour
|
||||
NextCar ();
|
||||
}
|
||||
|
||||
carVel = (math.abs(carRB.velocity.x) + math.abs(carRB.velocity.y) + math.abs(carRB.velocity.z))*5;
|
||||
//print(carVel);
|
||||
speedometer.SetText(carVel.ToString());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user