Beispiel #1
0
        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();
                }
            }
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        public static void Init()
        {
            InitWizard window = (InitWizard)EditorWindow.GetWindow(typeof(InitWizard), true, "");

            window.minSize = new Vector2(500, 500);
            window.maxSize = new Vector2(500, 500);
            window.Show();

            window.LoadKeys();
            window.selectedExportQuality = ExportSettings.HighSettings;

            window.GetSelectedSDKs();

            CognitiveVR_SceneExportWindow.ClearUploadSceneSettings();
        }
Beispiel #4
0
 static void Cognitive3DSceneSetup()
 {
     //open window
     InitWizard.Init();
 }
Beispiel #5
0
        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();
                }
            }
        }