Added respawn for AI, Game manager keeps track of laps

This commit is contained in:
2024-04-24 10:11:56 +02:00
parent f06887db7e
commit 6db70114b0
7 changed files with 369 additions and 1115 deletions

View File

@@ -15,8 +15,17 @@ public class CarLoader : MonoBehaviour
public GameObject targetcar;
void Start()
{
carType = GameObject.Find("Car Data").GetComponent<CarData>().carType;
carColor = GameObject.Find("Car Data").GetComponent<CarData>().carColor;
try
{
carType = GameObject.Find("Car Data").GetComponent<CarData>().carType;
carColor = GameObject.Find("Car Data").GetComponent<CarData>().carColor;
}
catch (System.Exception)
{
carType = "Racecar";
carColor = "Default";
print("no loading");
}
foreach (GameObject car in Cars)
{