win screen done

This commit is contained in:
magn9775
2024-04-26 14:20:12 +02:00
parent 03154fc543
commit f2cf92f5bb
3 changed files with 64 additions and 62 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using UnityEngine;
using TMPro;
using Unity.VisualScripting;
using System.Linq;
public class WinScript : MonoBehaviour
{
public TextMeshProUGUI MainText;
@@ -12,6 +13,7 @@ public class WinScript : MonoBehaviour
public GameObject[] Garages;
private GameObject currentGarage;
private string playercar = "";
void Start()
{
@@ -21,50 +23,50 @@ public class WinScript : MonoBehaviour
}
leaderboard = GameObject.Find("GameManager").GetComponent<GameManager>().playersFinished;
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);
}
if (leaderboard[0].Contains("player")){
}
if (leaderboard[0].Contains("Racecar"))
{
currentGarage = Garages[6];
Garages[6].SetActive(true);
}
else if (leaderboard[0].Contains("Hotrod"))
{
currentGarage = Garages[2];
Garages[2].SetActive(true);
}
else if (leaderboard[0].Contains("Icecream"))
{
currentGarage = Garages[5];
Garages[5].SetActive(true);
}
else if (leaderboard[0].Contains("Musclecar"))
{
currentGarage = Garages[1];
Garages[1].SetActive(true);
}
else if (leaderboard[0].Contains("Pickup"))
{
currentGarage = Garages[3];
Garages[3].SetActive(true);
}
else if (leaderboard[0].Contains("SchoolBus"))
{
currentGarage = Garages[7];
Garages[7].SetActive(true);
}
else if (leaderboard[0].Contains("Sportscar"))
{
currentGarage = Garages[4];
Garages[4].SetActive(true);
}
else if (leaderboard[0].Contains("Streetracist"))
{
currentGarage = Garages[0];
Garages[0].SetActive(true);
}
}