Driving UI 2

This commit is contained in:
2024-04-26 13:07:04 +02:00
parent 2fb03efc2a
commit 2fe54fe26e
6 changed files with 14 additions and 26 deletions

View File

@@ -28,10 +28,9 @@ public class GameManager : MonoBehaviour
playerLaps[i] = 1;
}
for (int i = 0; i < playerTimes.Count(); i++)
for (int i = 0; i < players.Count(); i++)
{
playerTimes[i] = 0;
playerTimesStr[i] = "DNF";
}
DontDestroyOnLoad(gameObject);
@@ -83,7 +82,7 @@ public class GameManager : MonoBehaviour
lapCounter.text = "Lap count: " + playerLaps[i];
}
timeCounter.text = playerTimes[i].ToString();
timeCounter.text = "Time: " + playerTimes[i].ToString();
}
if (playerLaps[i] > lapAmount)
@@ -98,7 +97,6 @@ public class GameManager : MonoBehaviour
player.GetComponent<PlayerController>().enabled = false;
playerTimesStr[i] = playerTimes[i].ToString();
}
}
@@ -106,6 +104,7 @@ public class GameManager : MonoBehaviour
// race finished
if (playersFinished.Count() == players.Count())
{
// if not finished DNF //TODO
SceneManager.LoadScene("WinScreen");
}