Ejemplo n.º 1
0
        //static System.Action RefreshSceneVersionComplete;
        /// <summary>
        /// get collection of versions of scene
        /// </summary>
        /// <param name="refreshSceneVersionComplete"></param>
        public static void RefreshMediaSources()
        {
            Debug.Log("refresh media sources");
            //gets the scene version from api and sets it to the current scene
            string currentSceneName = UnityEditor.SceneManagement.EditorSceneManager.GetActiveScene().name;
            var    currentSettings  = CognitiveVR_Preferences.FindScene(currentSceneName);

            if (currentSettings != null)
            {
                if (!IsDeveloperKeyValid)
                {
                    Debug.Log("Developer key invalid"); return;
                }

                if (currentSettings == null)
                {
                    Debug.Log("SendSceneVersionRequest no scene settings!");
                    return;
                }
                string url = Constants.GETMEDIASOURCELIST();

                Dictionary <string, string> headers = new Dictionary <string, string>();
                if (EditorCore.IsDeveloperKeyValid)
                {
                    headers.Add("Authorization", "APIKEY:DEVELOPER " + EditorCore.DeveloperKey);
                }

                EditorNetwork.Get(url, GetMediaSourcesResponse, headers, true, "Get Scene Version");//AUTH
            }
            else
            {
                Debug.Log("No scene versions for scene: " + currentSceneName);
            }
        }