Example #1
0
 void SetupConnection()
 {
     if (m_Connection == null)
     {
         return;
     }
     m_Connection.Register(LiveLinkMsg.PlayerRequestAssetForGUID, RequestAssetByGUID);
     m_Connection.Register(LiveLinkMsg.PlayerRequestAssetTargetHash, RequestAssetTargetHash);
     m_Connection.Register(LiveLinkMsg.PlayerRequestSubSceneTargetHash, RequestSubSceneTargetHash);
     m_Connection.Register(LiveLinkMsg.PlayerRequestSubSceneForGUID, RequestSubSceneByGUID);
 }
        void SetupConnection()
        {
            if (m_Connection == null)
            {
                return;
            }

            m_Connection.Register(LiveLinkMsg.PlayerRequestHandshakeLiveLink, RequestSessionHandshake);
            m_Connection.Register(LiveLinkMsg.PlayerRequestConnectLiveLink, ConnectLiveLink);
            m_Connection.Register(LiveLinkMsg.PlayerSetLoadedScenes, SetLoadedScenes);
            m_Connection.RegisterConnection(OnPlayerConnected);
            m_Connection.RegisterDisconnection(OnPlayerDisconnected);

            // After domain reload we need to reconnect all data to the player.
            // Optimally we would keep all state alive across domain reload...
            LiveLinkMsg.LogSend("ResetGame");
            m_Connection.Send(LiveLinkMsg.EditorResetGame, new byte[0]);
        }