Hello everybody , firstly I’m sorry for my bad english I have a issue with my script in coroutine , after “while” the script not read the next instructions I don’t know why
private void Update() {
if (isConnected == false)
return;
Scene scene = SceneManager.GetActiveScene ();
if (scene.name == "Map1")
ScreenLoaded = true;
}
IEnumerator OnAskName(string[] data) {
while (ScreenLoaded == false) {
Debug.Log ("En attente du chargement");
yield return new WaitForSecondsRealtime (0.100f);
}
Debug.Log ("test?");
ourClientId = int.Parse(data[1]);
// Send our name to the server
Send ("NAMEIS|" + playerName, reliableChannel);
// Create all the other players
for (int i = 2; i < data.Length - 1; i++) {
Debug.Log ("for");
string[] d = data [i].Split ('%');
if(d[0] != "TEMP")
SpawnPlayer (d [0], int.Parse (d [1]));
}
yield return null;
}
debug.log(“test?”) is not read
thanks in advance for your help .