void ConnectLiveLink(MessageEventArgs args)
        {
            LiveLinkMsg.LogReceived("ConnectLiveLink");

            int player = args.playerId;
            var buildConfigurationGuid = args.Receive <Hash128>();

            //@TODO: Implement this properly
            //system.World.GetExistingSystem<EditorSubSceneLiveLinkSystem>().CleanupAllScenes();

            //@TODO: How does this work with multiple connections?
            LiveLinkAssetBundleBuildSystem.instance.ClearTrackedAssets();
            if (_Connections.TryGetValue(player, out var connection))
            {
                connection.Dispose();
            }

            var newConnection = new LiveLinkConnection(buildConfigurationGuid);

            _Connections[player] = newConnection;
            using (var scenes = newConnection.GetInitialScenes(player, Allocator.Temp))
                m_Connection.SendArray(LiveLinkMsg.EditorResponseConnectLiveLink, scenes, player);

            TimeBasedCallbackInvoker.SetCallback(DetectSceneChanges);
            EditorUpdateUtility.EditModeQueuePlayerLoopUpdate();

            LiveLinkPlayerConnected?.Invoke(player, newConnection._BuildConfigurationGUID);
        }
Esempio n. 2
0
        void ConnectLiveLink(MessageEventArgs args)
        {
            LiveLinkMsg.LogReceived("ConnectLiveLink");

            int player        = args.playerId;
            var buildSettings = args.Receive <Hash128>();

            //@TODO: Implement this properly
            //system.World.GetExistingSystem<EditorSubSceneLiveLinkSystem>().CleanupAllScenes();

            //@TODO: How does this work with multiple connections?
            LiveLinkAssetBundleBuildSystem.instance.ClearUsedAssetsTargetHash();
            if (_Connections.TryGetValue(player, out var connection))
            {
                connection.Dispose();
            }

            var newConnection = new LiveLinkConnection(buildSettings);

            _Connections[player] = newConnection;

            TimeBasedCallbackInvoker.SetCallback(DetectSceneChanges);
            EditorUpdateUtility.EditModeQueuePlayerLoopUpdate();

            LiveLinkPlayerConnected?.Invoke(player, newConnection._BuildSettingsGUID);
        }