This commit is contained in:
2024-04-26 09:20:13 +02:00
parent 6dd5933873
commit 1218b7870f
5 changed files with 49 additions and 9 deletions

View File

@@ -8,6 +8,7 @@ public class GameManager : MonoBehaviour
public int lapAmount;
public GameObject[] checkpoints;
public GameObject[] players;
[HideInInspector] public string[] playersFinished;
int[] playerLaps;
void Start()
@@ -28,6 +29,9 @@ public class GameManager : MonoBehaviour
{
GameObject player = players[i];
if (playersFinished.Contains(player.name))
continue;
bool isAI = true;
if (player.GetComponent<PlayerController>().enabled)
isAI = false;
@@ -56,8 +60,12 @@ public class GameManager : MonoBehaviour
if (playerLaps[i] > lapAmount)
{
player.GetComponent<Rigidbody>().isKinematic = true;
}
playersFinished.Append(player.name);
print("\nPlayers finished:");
foreach (string pp in playersFinished)
print(pp);
}
}
}
}