protected virtual void ReadBinaryClient(NetworkingPlayer pPlayer, Binary pFrame, NetWorker pSender)
        {
            if (pFrame.GroupId == CustomMessageGroupIds.PLAYER_CHANGE_NETWORK_SCENE)
            {
                byte[] data = pFrame.StreamData.byteArr;
                RPCPlayerChangeNetworkScene changeSceneRPC = data.ByteArrayToObject <RPCPlayerChangeNetworkScene>();
                NetworkSceneTemplate        sceneTemplate  = RPCPlayerChangeNetworkScene.ToNetworkSceneTemplate(changeSceneRPC);
                MainThreadManager.Run(() => {
                    if (NodeManager.IsInitialized)
                    {
                        NodeManager.Instance.UnloadNetworkScenes(true, true);
                        NodeManager.Instance.RaisePlayerChangingNetworkScene(sceneTemplate);
                        NetworkSceneItem item = NodeManager.Instance.CreateNetworkScene(sceneTemplate, true);
                        if (item == null)
                        {
                            NodeManager.Instance.PlayerChangingSceneFailed(item);
                            return;
                        }

                        if (item.IsReady)
                        {
                            NodeManager.Instance.PlayerChangingSceneSucceeded(item);
                        }
                        else
                        {
                            item.OnReady    += NodeManager.Instance.PlayerChangingSceneSucceeded;
                            item.OnUnloaded += NodeManager.Instance.PlayerChangingSceneFailed;
                        }
                    }
                });

                return;
            }
        }
        public static NetworkSceneTemplate ToNetworkSceneTemplate(RPCPlayerChangeNetworkScene pChangeSceneRPC)
        {
            NetworkSceneTemplate template = new NetworkSceneTemplate(pChangeSceneRPC.buildIndex, pChangeSceneRPC.sceneName, pChangeSceneRPC.sceneOffset, new NetworkSceneManagerSetting());

            template.Settings.UseTCP = pChangeSceneRPC.useTCP;
            template.Settings.UseMainThreadManagerForRPCs = pChangeSceneRPC.useMainThreadManagerForRPCs;
            template.Settings.ClientAddress.FromRPC(pChangeSceneRPC.clientAddress);
            template.Settings.ClientNATAddress.FromRPC(pChangeSceneRPC.clientNATAddress);
            return(template);
        }
        public virtual bool ChangePlayerNetworkScene(NetworkSceneTemplate pTemplate, NetworkingPlayer pPlayer)
        {
            if (pTemplate == null)
            {
                return(false);
            }

            RPCPlayerChangeNetworkScene changeSceneRPC = RPCPlayerChangeNetworkScene.FromNetworkSceneTemplate(pTemplate);
            Binary sceneTemplateFrame = new Binary(_networker.Time.Timestep, false, changeSceneRPC.ObjectToByteArray(), Receivers.Target, CustomMessageGroupIds.PLAYER_CHANGE_NETWORK_SCENE, pPlayer.Networker is BaseTCP);

            SendFrame(sceneTemplateFrame, pPlayer);
            return(true);
        }