protected override void OnCreate()
 {
     LiveLinkUtility.LiveLinkBoot();
     Enabled = LiveLinkUtility.LiveLinkEnabled;
     if (Enabled)
     {
         World.GetOrCreateSystem <SceneSystem>().BuildConfigurationGUID = LiveLinkUtility.BuildConfigurationGUID;
     }
 }
Ejemplo n.º 2
0
        void ResponseSessionHandshake(MessageEventArgs args)
        {
            var editorLiveLinkId = args.Receive <long>();

            if (editorLiveLinkId != LiveLinkUtility.LiveLinkId)
            {
                Debug.LogError("Editor returned invalid LiveLink Id. We are probably connected to the wrong Editor (or an AssetImportWorker). Close extra Editors and run the LiveLink player again.");
                LiveLinkUtility.DisableLiveLink();
                World.GetExistingSystem <LiveLinkRuntimeSystemGroup>().Enabled = false;
                return;
            }

            m_SessionHandshake = true;
        }
        void ResponseSessionHandshake(MessageEventArgs args)
        {
            #if !UNITY_EDITOR
            var editorHandshake = args.Receive <LiveLinkHandshake>();
            if (editorHandshake.LiveLinkId != LiveLinkUtility.LiveLinkId)
            {
                Debug.LogError("Editor returned invalid LiveLink Id. We are probably connected to the wrong Editor (or an AssetImportWorker). Close extra Editors and run the LiveLink player again.");
                LiveLinkUtility.DisableLiveLink();
                World.GetExistingSystem <LiveLinkRuntimeSystemGroup>().Enabled = false;
                return;
            }

            if (editorHandshake.LiveLinkCacheGUID != LiveLinkUtility.LiveLinkCacheGUID)
            {
                Debug.Log($"Editor LiveLink Cache GUID is different (Editor: {editorHandshake.LiveLinkCacheGUID.ToString()} != Player: {LiveLinkUtility.LiveLinkCacheGUID.ToString()}) - Clearing local LiveLink cache.");
                LiveLinkUtility.ClearPlayerLiveLinkCache();
                LiveLinkUtility.LiveLinkCacheGUID = editorHandshake.LiveLinkCacheGUID;
                LiveLinkUtility.WritePlayerLiveLinkCacheGUID();
            }
            #endif

            m_SessionHandshake = true;
        }