Beispiel #1
0
        protected override void OnStartRunning()
        {
            Debug.Log("Initializing live link");
            m_Connection.Register(LiveLinkMsg.EditorResponseHandshakeLiveLink, ResponseSessionHandshake);
            m_Connection.Register(LiveLinkMsg.EditorReceiveEntityChangeSet, ReceiveEntityChangeSet);
            m_Connection.Register(LiveLinkMsg.EditorUnloadScenes, ReceiveUnloadScenes);
            m_Connection.Register(LiveLinkMsg.EditorLoadScenes, ReceiveLoadScenes);
            m_Connection.Register(LiveLinkMsg.EditorResetGame, ReceiveResetGame);
            m_Connection.Register(LiveLinkMsg.EditorResponseConnectLiveLink, ReceiveInitialScenes);

            m_ResourcePacketQueue = new Queue <EntityChangeSetSerialization.ResourcePacket>();
            m_Resources           = GetEntityQuery(new EntityQueryDesc
            {
                All = new[] { ComponentType.ReadOnly <ResourceGUID>() }
            });

            m_Patcher = new LiveLinkPatcher(World);

            m_LiveLinkSceneChange = new LiveLinkSceneChangeTracker(EntityManager);

            // Send handshake and set timeout
            PlayerConnection.instance.Send(LiveLinkMsg.PlayerRequestHandshakeLiveLink, new byte[0]);
            m_SessionHandshakeTimeoutTimstamp = Time.ElapsedTime + kSessionHandshakeTimeout;
            m_SessionHandshake = false;
        }
Beispiel #2
0
        protected override void OnStartRunning()
        {
            Debug.Log("Initializing live link");

            PlayerConnection.instance.Register(LiveLinkMsg.ReceiveEntityChangeSet, ReceiveEntityChangeSet);
            PlayerConnection.instance.Register(LiveLinkMsg.UnloadScenes, ReceiveUnloadScenes);
            PlayerConnection.instance.Register(LiveLinkMsg.LoadScenes, ReceiveLoadScenes);
            PlayerConnection.instance.Register(LiveLinkMsg.ResetGame, ReceiveResetGame);

            m_ResourcePacketQueue = new Queue <EntityChangeSetSerialization.ResourcePacket>();
            m_Resources           = GetEntityQuery(new EntityQueryDesc
            {
                All = new [] { ComponentType.ReadOnly <ResourceGUID>() }
            });

            m_Patcher = new LiveLinkPatcher(World);

            m_LiveLinkSceneChange = new LiveLinkSceneChangeTracker(EntityManager);
        }