IEnumerator IntervaledTick() { while (true) { yield return(_waitForSecondsEnumerator); { var clientPlayersSpawn = ReadClientPlayerspawningDataServiceRequest(); int targetsCount; var netEntityViews = entitiesDB.QueryEntities <NetEntityView>(out targetsCount); for (int i = 0; i < targetsCount; i++) { netEntityViews[i].netComponent.countPlayer = PhotonNetwork.room.playerCount; if (netEntityViews[i].netComponent.isJoinedRoom) { // for (int j = num ; j != netEntityViews[i].netComponent.countPlayer ; ++j) // { // _clientFactory.Build(clientPlayersSpawn[0].clientPlayerSawnData); //// netDatas[j].playerName = PhotonNetwork.playerName; // Utility.Console.Log("Build " + PhotonNetwork.playerName); //// namecheck = PhotonNetwork.playerName; // Utility.Console.Log("user: " + PhotonNetwork.room.playerCount); // num++; // } for (int j = num; j >= 0 && num >= PhotonNetwork.room.playerCount; --j) { _clientFactory.Build(clientPlayersSpawn[0].clientPlayerSawnData); num = num - num; } } } } } }