win music
This commit is contained in:
@@ -18,6 +18,7 @@ public class GameManager : MonoBehaviour
|
||||
int[] playerLaps;
|
||||
public TextMeshProUGUI lapCounter;
|
||||
public TextMeshProUGUI timeCounter;
|
||||
float DNFTimer = 0;
|
||||
void Start()
|
||||
{
|
||||
// reset laps
|
||||
@@ -115,9 +116,14 @@ public class GameManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
//DNF
|
||||
if (playersFinished.Count() > 0)
|
||||
{
|
||||
DNFTimer += Time.deltaTime;
|
||||
}
|
||||
|
||||
// race finished
|
||||
if (playersFinished.Count() == players.Count())
|
||||
if (playersFinished.Count() == players.Count() || DNFTimer > 10)
|
||||
{
|
||||
// sort array
|
||||
float[] fTimes = new float[players.Count()];
|
||||
@@ -145,5 +151,7 @@ public class GameManager : MonoBehaviour
|
||||
SceneManager.LoadScene("WinScreen");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user