UnityEngine.Networking.NetworkManager.OnClientSceneChanged C# (CSharp) Method

OnClientSceneChanged() public method

Called on clients when a scene has completed loaded, when the scene load was initiated by the server.

public OnClientSceneChanged ( NetworkConnection conn ) : void
conn NetworkConnection The network connection that the scene change message arrived on.
return void
        public virtual void OnClientSceneChanged(NetworkConnection conn)
        {
            ClientScene.Ready(conn);
            if (this.m_AutoCreatePlayer)
            {
                bool flag = ClientScene.localPlayers.Count == 0;
                bool flag2 = false;
                for (int i = 0; i < ClientScene.localPlayers.Count; i++)
                {
                    if (ClientScene.localPlayers[i].gameObject != null)
                    {
                        flag2 = true;
                        break;
                    }
                }
                if (!flag2)
                {
                    flag = true;
                }
                if (flag)
                {
                    ClientScene.AddPlayer(0);
                }
            }
        }