protected override void OnCreate()
        {
#if UNITY_ANDROID
            var uwrFile = new UnityWebRequest(SceneSystem.GetBootStrapPath());
            uwrFile.SendWebRequest();
            while (!uwrFile.isDone)
            {
            }

            if (uwrFile.isNetworkError || uwrFile.isHttpError)
            {
                Enabled = false;
            }
            else
            {
                Enabled = true;
            }
#else
            Enabled = File.Exists(SceneSystem.GetBootStrapPath());
#endif
            if (Enabled)
            {
                if (!UnityEngine.Networking.PlayerConnection.PlayerConnection.instance.isConnected)
                {
                    Debug.LogError("Failed to connect to the Editor.\nAn Editor connection is required for LiveLink to work.");
                }
            }
        }
Ejemplo n.º 2
0
        protected override void OnCreate()
        {
#if UNITY_ANDROID
            var uwrFile = new UnityWebRequest(SceneSystem.GetBootStrapPath());
            uwrFile.SendWebRequest();
            while (!uwrFile.isDone)
            {
            }

            if (uwrFile.isNetworkError || uwrFile.isHttpError)
            {
                Enabled = false;
            }
            else
            {
                Enabled = true;
            }
#else
            var bootstrapFilePath = GetBootStrapPath();
            Enabled = File.Exists(bootstrapFilePath);
#endif
            if (Enabled)
            {
                if (!UnityEngine.Networking.PlayerConnection.PlayerConnection.instance.isConnected)
                {
                    Debug.LogError("Failed to connect to the Editor.\nAn Editor connection is required for LiveLink to work.");
                }

                using (var rdr = File.OpenText(bootstrapFilePath))
                {
                    var buildConfigurationGUID = new Hash128(rdr.ReadLine());
                    LiveLinkSessionId = long.Parse(rdr.ReadLine() ?? throw new Exception("Expected line in bootstrap containing session id!"));
                    World.GetOrCreateSystem <SceneSystem>().BuildConfigurationGUID = buildConfigurationGUID;
                }
            }
        }
Ejemplo n.º 3
0
 protected override void OnCreate()
 {
     Enabled = File.Exists(SceneSystem.GetBootStrapPath());
 }