win screeen
This commit is contained in:
File diff suppressed because it is too large
Load Diff
36
Assets/Scripts/WinScript.cs
Normal file
36
Assets/Scripts/WinScript.cs
Normal 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] + ")";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
11
Assets/Scripts/WinScript.cs.meta
Normal file
11
Assets/Scripts/WinScript.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b13d76627d1fce14691aad7164419d13
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user