void Update() { if (m_MaxManagedPlayer < 0) { CalcMaxPlayer(); } else { if (needSyncNumToServer) { needSyncNumToServer = false; } } FreshQueue(); if (!m_IsCanShow) { return; } if (!GM.AssetManager.IsIdle) { return; } if (m_PlayerQueue.Count > 0) { PlayerDelegate playerdata = m_PlayerQueue.Dequeue(); if (playerdata != null) { if (playerdata.sceneid != m_CurrentSceneID) { //#if PRINT_PLAYER_SYNC_DEBUG // EB.Debug.LogWarning("Player not this scene uid=" + playerdata.id); //#endif m_ManagedPlayers.Remove(playerdata.id); } else if (m_ManagedPlayers.ContainsKey(playerdata.id)) { if (!playerdata.preloaded) { if (m_CurrentSceneLogic != null) { m_CurrentSceneLogic.PreloadAsync(playerdata.id, (success) => { playerdata.preloaded = success; m_PlayerQueue.Enqueue(playerdata); }); } else { EB.Debug.LogError("CurrentSceneLogic is Null"); } } else if (!m_ManagedPlayers[playerdata.id].created) { m_ManagedPlayers[playerdata.id].created = true; if (m_CurrentSceneLogic != null) { m_CurrentSceneLogic.CreateOtherPlayer(playerdata.pos, playerdata.quater, playerdata.id); } else { EB.Debug.LogError("CurrentSceneLogic is Null"); } } } //#if PRINT_PLAYER_SYNC_DEBUG // CheckConsistent(); //#endif } } else { MatchPlayersToMaxManagerPlayer(); } }