void DrawFooter() { GUI.color = EditorCore.BlueishGrey; GUI.DrawTexture(new Rect(0, 500, 550, 50), EditorGUIUtility.whiteTexture); GUI.color = Color.white; string tooltip = ""; var currentScene = CognitiveVR_Preferences.FindCurrentScene(); if (currentScene == null || string.IsNullOrEmpty(currentScene.SceneId)) { tooltip = "Upload list of all Dynamic Object IDs. Scene settings not saved"; } else { tooltip = "Upload list of all Dynamic Object IDs and Mesh Names to " + currentScene.SceneName + " version " + currentScene.VersionNumber; } bool enabled = !(currentScene == null || string.IsNullOrEmpty(currentScene.SceneId)); //EditorGUI.BeginDisabledGroup(enabled); //EditorGUI.EndDisabledGroup(); if (enabled) { if (GUI.Button(new Rect(80, 510, 350, 30), new GUIContent("Upload Ids to SceneExplorer for Aggregation", tooltip))) { EditorCore.RefreshSceneVersion(delegate() { ManageDynamicObjects.UploadManifest(null); }); } } else { var scene = UnityEditor.SceneManagement.EditorSceneManager.GetActiveScene(); string errorMessage = "<color=#880000ff>This scene <color=red>" + scene.name.ToUpper() + "</color> does not have a valid SceneId.\n\nPlease upload this scene using the Scene Setup Window</color>"; if (!EditorCore.IsDeveloperKeyValid) { errorMessage = "Developer Key not set"; } EditorGUI.BeginDisabledGroup(true); GUI.Button(new Rect(80, 510, 350, 30), new GUIContent("Upload Ids to SceneExplorer for Aggregation", tooltip)); EditorGUI.EndDisabledGroup(); GUI.color = new Color(1, 0.9f, 0.9f); GUI.DrawTexture(new Rect(0, 420, 550, 150), EditorGUIUtility.whiteTexture); GUI.color = Color.white; GUI.Label(new Rect(30, 430, 430, 30), errorMessage, "normallabel"); if (GUI.Button(new Rect(380, 510, 80, 30), "Fix")) { InitWizard.Init(); } } }
static EditorCore() { //Debug.Log("CognitiveVR EditorCore constructor"); //check sdk versions CheckForUpdates(); if (!EditorPrefs.HasKey("cognitive_init_popup")) { InitWizard.Init(); } EditorPrefs.SetBool("cognitive_init_popup", true); }
static void Cognitive3DSceneSetup() { //open window InitWizard.Init(); }
void DrawFooter() { GUI.color = EditorCore.BlueishGrey; GUI.DrawTexture(new Rect(0, 500, 550, 50), EditorGUIUtility.whiteTexture); GUI.color = Color.white; string tooltip = ""; var currentScene = CognitiveVR_Preferences.FindCurrentScene(); if (currentScene == null || string.IsNullOrEmpty(currentScene.SceneId)) { tooltip = "Upload list of all Dynamic Object IDs. Scene settings not saved"; } else { tooltip = "Upload list of all Dynamic Object IDs and Mesh Names to " + currentScene.SceneName + " version " + currentScene.VersionNumber; } bool enabled = !(currentScene == null || string.IsNullOrEmpty(currentScene.SceneId)) && lastResponseCode == 200; if (enabled) { if (GUI.Button(new Rect(80, 510, 350, 30), new GUIContent("Upload Ids to SceneExplorer for Aggregation", tooltip))) { EditorCore.RefreshSceneVersion(delegate() { AggregationManifest manifest = new AggregationManifest(); AddOrReplaceDynamic(manifest, GetDynamicObjectsInScene()); //Important! this should never upload Id Pools automatically! possible these aren't wanted in a scene and will clutter dashboard ManageDynamicObjects.UploadManifest(manifest, null); }); } } else { var scene = UnityEditor.SceneManagement.EditorSceneManager.GetActiveScene(); string errorMessage; if (lastResponseCode != 200) { errorMessage = "<color=#880000ff>The Developer Key is Invalid or Expired.\n\nPlease visit the project on our dashboard and update the key in the Scene Setup Window</color>"; } else { errorMessage = "<color=#880000ff>This scene <color=red>" + scene.name.ToUpper() + "</color> does not have a valid SceneId.\n\nPlease upload this scene using the Scene Setup Window</color>"; } if (!EditorCore.IsDeveloperKeyValid) { errorMessage = "Developer Key not set"; } EditorGUI.BeginDisabledGroup(true); GUI.Button(new Rect(80, 510, 350, 30), new GUIContent("Upload Ids to SceneExplorer for Aggregation", tooltip)); EditorGUI.EndDisabledGroup(); GUI.color = new Color(1, 0.9f, 0.9f); GUI.DrawTexture(new Rect(0, 420, 550, 150), EditorGUIUtility.whiteTexture); GUI.color = Color.white; GUI.Label(new Rect(30, 430, 430, 30), errorMessage, "normallabel"); if (GUI.Button(new Rect(380, 510, 80, 30), "Fix")) { InitWizard.Init(); } } }