L
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user