win screeen

This commit is contained in:
magn9775
2024-04-26 10:20:40 +02:00
parent d491c6dee7
commit dcdd1e0965
3 changed files with 1457 additions and 131 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,36 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class WinScript : MonoBehaviour
{
public TextMeshProUGUI MainText;
public List<string> leaderboard;
public List<string> time;
void Start()
{
leaderboard = GameObject.Find("GameManager").GetComponent<GameManager>().PlayerFinished;
carColor = GameObject.Find("Car Data").GetComponent<CarData>().carColor;
foreach (GameObject car in Cars)
{
if (car.name == carType)
{
replaceCar(car, carColor);
}
}
}
private void Update()
{
MainText.text = "Leaderboard: ";
for (var i = 0; i < leaderboard.Count; i++){
MainText.text += "\n" + (i+1) + "." + leaderboard[i] + "(" + time[i] + ")";
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b13d76627d1fce14691aad7164419d13
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: