noah siger skub

This commit is contained in:
magn9775
2024-04-26 13:00:17 +02:00
parent 32585ae931
commit b22fab97c5
2 changed files with 48 additions and 52 deletions

View File

@@ -20,65 +20,61 @@ public class WinScript : MonoBehaviour
carGarage.SetActive(false);
}
leaderboard = GameObject.Find("GameManager").GetComponent<GameManager>().playersFinished;
time = GameObject.Find("GameManager").GetComponent<GameManager>().playerTimes;
if (leaderboard[0] == "Racecar")
{
currentGarage = Garages[6];
Garages[6].SetActive(true);
time = GameObject.Find("GameManager").GetComponent<GameManager>().playerTimesSTR;
if (leaderboard[0].Contains("Player")){
Garages[0].SetActive(true);
}else{
if (leaderboard[0] == "Racecar")
{
currentGarage = Garages[6];
Garages[6].SetActive(true);
}
else if (leaderboard[0] == "Hotrod")
{
currentGarage = Garages[2];
Garages[2].SetActive(true);
}
else if (leaderboard[0] == "Icecream")
{
currentGarage = Garages[5];
Garages[5].SetActive(true);
}
else if (leaderboard[0] == "MuscleCar")
{
currentGarage = Garages[1];
Garages[1].SetActive(true);
}
else if (leaderboard[0] == "Pickup")
{
currentGarage = Garages[3];
Garages[3].SetActive(true);
}
else if (leaderboard[0] == "SchoolBus")
{
currentGarage = Garages[7];
Garages[7].SetActive(true);
}
else if (leaderboard[0] == "Sportscar")
{
currentGarage = Garages[4];
Garages[4].SetActive(true);
}
else if (leaderboard[0] == "StreetRacist")
{
currentGarage = Garages[0];
Garages[0].SetActive(true);
}
}
else if (leaderboard[0] == "Hotrod")
{
currentGarage = Garages[2];
Garages[2].SetActive(true);
}
else if (leaderboard[0] == "Icecream")
{
currentGarage = Garages[5];
Garages[5].SetActive(true);
}
else if (leaderboard[0] == "MuscleCar")
{
currentGarage = Garages[1];
Garages[1].SetActive(true);
}
else if (leaderboard[0] == "Pickup")
{
currentGarage = Garages[3];
Garages[3].SetActive(true);
}
else if (leaderboard[0] == "SchoolBus")
{
currentGarage = Garages[7];
Garages[7].SetActive(true);
}
else if (leaderboard[0] == "Sportscar")
{
currentGarage = Garages[4];
Garages[4].SetActive(true);
}
else if (leaderboard[0] == "StreetRacist")
{
currentGarage = Garages[0];
Garages[0].SetActive(true);
}
}
private void Update()
{
MainText.text = "Leaderboard: ";
MainText2.text = "Time: ";
for (var i = 0; i < leaderboard.Count; i++){
MainText.text += "\n" + (i+1) + "." + leaderboard[i];
MainText2.text += "\n(" + time[i] + ")";
}
}
private void FixedUpdate() {
currentGarage.transform.eulerAngles += Vector3.up * 0.7f;
//currentRotation = CurrentCar.transform.rotation;