fix errors

This commit is contained in:
magn9775
2024-04-26 18:31:17 +02:00
parent 2edf1925ca
commit 61d1958308
3 changed files with 153 additions and 17 deletions

View File

@@ -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());
}