Пример #1
0
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured())
            {
                return;
            }

            if (GUILayout.Button("Back to Configuration Profile"))
            {
                Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile;
            }

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Network System Profile", EditorStyles.boldLabel);
            EditorGUILayout.HelpBox("The Network System Profile helps developers configure networking messages no matter what platform you're building for.", MessageType.Info);

            (target as BaseMixedRealityProfile).CheckProfileLock();

            serializedObject.Update();

            EditorGUI.BeginChangeCheck();
            EditorGUILayout.PropertyField(registeredNetworkDataProviders, true);

            if (EditorGUI.EndChangeCheck())
            {
                EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetConfiguration(MixedRealityToolkit.Instance.ActiveProfile);
            }

            serializedObject.ApplyModifiedProperties();
        }
        private void OnGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            errors.Clear();

            if (!creator.ValidateAssets(errors))
            {
                EditorGUILayout.LabelField("Validating assets...");
                RenderErrorLog();
                return;
            }

            switch (creator.Stage)
            {
            case ExtensionServiceCreator.CreationStage.SelectNameAndPlatform:
                DrawSelectNameAndPlatform();
                break;

            case ExtensionServiceCreator.CreationStage.ChooseOutputFolders:
                DrawChooseOutputFolders();
                break;

            case ExtensionServiceCreator.CreationStage.CreatingExtensionService:
            case ExtensionServiceCreator.CreationStage.CreatingProfileInstance:
                DrawCreatingAssets();
                break;

            case ExtensionServiceCreator.CreationStage.Finished:
                DrawFinished();
                break;
            }
        }
Пример #3
0
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            if (inputSystemProfile != null &&
                GUILayout.Button("Back to Input Profile"))
            {
                Selection.activeObject = inputSystemProfile;
            }

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Gesture Input", EditorStyles.boldLabel);
            EditorGUILayout.HelpBox("This gesture map is any and all movements of part the user's body, especially a hand or the head, that raise actions through the input system.\n\nNote: Defined controllers can look up the list of gestures and raise the events based on specific criteria.", MessageType.Info);

            if (inputSystemProfile == null)
            {
                EditorGUILayout.HelpBox("No input system profile found, please specify a input system profile in the main configuration.", MessageType.Error);
                return;
            }

            if (inputSystemProfile.InputActionsProfile == null)
            {
                EditorGUILayout.HelpBox("No input actions found, please specify a input action profile in the main configuration.", MessageType.Error);
                return;
            }

            gesturesProfile.CheckProfileLock();

            serializedObject.Update();
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Defined Recognizable Gestures", EditorStyles.boldLabel);
            RenderList(gestures);
            serializedObject.ApplyModifiedProperties();
        }
Пример #4
0
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            if (thisProfile.ParentProfile != null &&
                GUILayout.Button("Back to Configuration Profile"))
            {
                Selection.activeObject = thisProfile.ParentProfile;
            }

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Camera Profile", EditorStyles.boldLabel);
            EditorGUILayout.HelpBox("The Camera Profile helps tweak camera settings no matter what platform you're building for.", MessageType.Info);

            thisProfile.CheckProfileLock();

            serializedObject.Update();

            EditorGUI.BeginChangeCheck();

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Global Settings:", EditorStyles.boldLabel);
            EditorGUILayout.PropertyField(isCameraPersistent);
            EditorGUILayout.PropertyField(cameraRigType);
            EditorGUILayout.PropertyField(defaultHeadHeight);
            EditorGUILayout.PropertyField(bodyAdjustmentAngle);
            EditorGUILayout.PropertyField(bodyAdjustmentSpeed);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Opaque Display Settings:", EditorStyles.boldLabel);
            EditorGUILayout.PropertyField(opaqueNearClip, nearClipTitle);
            EditorGUILayout.PropertyField(opaqueClearFlags, clearFlagsTitle);

            if ((CameraClearFlags)opaqueClearFlags.intValue == CameraClearFlags.Color)
            {
                opaqueBackgroundColor.colorValue = EditorGUILayout.ColorField("Background Color", opaqueBackgroundColor.colorValue);
            }

            opaqueQualityLevel.intValue = EditorGUILayout.Popup("Quality Setting", opaqueQualityLevel.intValue, QualitySettings.names);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Transparent Display Settings:", EditorStyles.boldLabel);
            EditorGUILayout.PropertyField(transparentNearClip, nearClipTitle);
            EditorGUILayout.PropertyField(transparentClearFlags, clearFlagsTitle);

            if ((CameraClearFlags)transparentClearFlags.intValue == CameraClearFlags.Color)
            {
                transparentBackgroundColor.colorValue = EditorGUILayout.ColorField("Background Color", transparentBackgroundColor.colorValue);
            }

            transparentQualityLevel.intValue = EditorGUILayout.Popup("Quality Setting", transparentQualityLevel.intValue, QualitySettings.names);

            serializedObject.ApplyModifiedProperties();

            if (MixedRealityToolkit.IsInitialized && EditorGUI.EndChangeCheck())
            {
                EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetConfiguration(MixedRealityToolkit.Instance.ActiveProfile);
            }
        }
Пример #5
0
 public override void OnInspectorGUI()
 {
     MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();
     EditorGUILayout.LabelField("The Mixed Reality Toolkit", HeaderStyle);
     EditorGUILayout.Space();
     EditorGUILayout.Space();
     RenderSystemFields();
 }
 public override void OnInspectorGUI()
 {
     MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();
     GUI.enabled = !MixedRealityPreferences.LockProfiles;
     serializedObject.Update();
     EditorGUILayout.PropertyField(mixedRealityPackages, true);
     serializedObject.ApplyModifiedProperties();
 }
Пример #7
0
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            if (thisProfile.ParentProfile != null &&
                GUILayout.Button("Back to Configuration Profile"))
            {
                Selection.activeObject = thisProfile.ParentProfile;
            }

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Boundary Visualization Options", EditorStyles.boldLabel);
            EditorGUILayout.HelpBox("Boundary visualizations can help users stay oriented and comfortable in the experience.", MessageType.Info);
            EditorGUILayout.Space();

            (target as BaseMixedRealityProfile).CheckProfileLock();

            serializedObject.Update();
            EditorGUILayout.PropertyField(boundaryHeight);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Floor Settings:", EditorStyles.boldLabel);
            EditorGUILayout.PropertyField(showFloor, showContent);
            EditorGUILayout.PropertyField(floorMaterial, materialContent);
            var prevWideMode = EditorGUIUtility.wideMode;

            EditorGUIUtility.wideMode = true;
            EditorGUILayout.PropertyField(floorScale, scaleContent, GUILayout.ExpandWidth(true));
            EditorGUIUtility.wideMode = prevWideMode;
            EditorGUILayout.PropertyField(floorPhysicsLayer);

            GUILayout.Space(12f);
            EditorGUILayout.LabelField("Play Area Settings:", EditorStyles.boldLabel);
            EditorGUILayout.PropertyField(showPlayArea, showContent);
            EditorGUILayout.PropertyField(playAreaMaterial, materialContent);
            EditorGUILayout.PropertyField(playAreaPhysicsLayer);

            GUILayout.Space(12f);
            EditorGUILayout.LabelField("Tracked Area Settings:", EditorStyles.boldLabel);
            EditorGUILayout.PropertyField(showTrackedArea, showContent);
            EditorGUILayout.PropertyField(trackedAreaMaterial, materialContent);
            EditorGUILayout.PropertyField(trackedAreaPhysicsLayer);

            GUILayout.Space(12f);
            EditorGUILayout.LabelField("Boundary Wall Settings:", EditorStyles.boldLabel);
            EditorGUILayout.PropertyField(showBoundaryWalls, showContent);
            EditorGUILayout.PropertyField(boundaryWallMaterial, materialContent);
            EditorGUILayout.PropertyField(boundaryWallsPhysicsLayer);

            GUILayout.Space(12f);
            EditorGUILayout.LabelField("Boundary Ceiling Settings:", EditorStyles.boldLabel);
            EditorGUILayout.PropertyField(showBoundaryCeiling, showContent);
            EditorGUILayout.PropertyField(boundaryCeilingMaterial, materialContent);
            EditorGUILayout.PropertyField(ceilingPhysicsLayer);

            serializedObject.ApplyModifiedProperties();
        }
Пример #8
0
        /// <summary>
        /// Render the Mixed Reality Toolkit Logo.
        /// </summary>
        protected void RenderMRTKLogo()
        {
            // If we're being rendered as a sub profile, don't show the logo
            if (RenderAsSubProfile)
            {
                return;
            }

            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();
        }
Пример #9
0
        /// <inheritdoc />
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured())
            {
                return;
            }

            if (!MixedRealityToolkit.Instance.ActiveProfile.IsSpatialAwarenessSystemEnabled)
            {
                EditorGUILayout.HelpBox("The Spatial Awareness Observer Data Provider requires that the spatial awareness system be enabled.", MessageType.Error);

                if (GUILayout.Button("Back to Configuration Profile"))
                {
                    Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile;
                }

                return;
            }

            if (GUILayout.Button("Back to Spatial Awareness Profile"))
            {
                Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile.SpatialAwarenessProfile;
            }


            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Spatial Observer Options", EditorStyles.boldLabel);
            EditorGUILayout.HelpBox("The Spatial Awareness Observer Data Provider supplies the Spatial Awareness system with all the data it needs to understand the world around you.", MessageType.Info);
            EditorGUILayout.Space();

            if (MixedRealityPreferences.LockProfiles && !((BaseMixedRealityProfile)target).IsCustomProfile)
            {
                GUI.enabled = false;
            }

            serializedObject.Update();

            foldout = EditorGUILayout.Foldout(foldout, "General Settings", true);

            if (foldout)
            {
                EditorGUI.indentLevel++;
                EditorGUILayout.PropertyField(startupBehavior);
                EditorGUILayout.PropertyField(observationExtents);
                EditorGUILayout.PropertyField(isStationaryObserver);
                EditorGUILayout.PropertyField(updateInterval);
                EditorGUILayout.PropertyField(physicsLayer);
                EditorGUI.indentLevel--;
            }

            serializedObject.ApplyModifiedProperties();
        }
        protected void RenderHeader()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            if (ThisProfile.ParentProfile != null &&
                GUILayout.Button("Back to parent profile"))
            {
                Selection.activeObject = ThisProfile.ParentProfile;
            }

            EditorGUILayout.Space();
        }
Пример #11
0
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured())
            {
                return;
            }

            if (!MixedRealityToolkit.Instance.ActiveProfile.IsInputSystemEnabled)
            {
                EditorGUILayout.HelpBox("No input system is enabled, or you need to specify the type in the main configuration profile.", MessageType.Error);

                if (GUILayout.Button("Back to Configuration Profile"))
                {
                    Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile;
                }

                return;
            }

            if (GUILayout.Button("Back to Input Profile"))
            {
                Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile;
            }

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Gesture Input", EditorStyles.boldLabel);
            EditorGUILayout.HelpBox("This gesture map is any and all movements of part the user's body, especially a hand or the head, that raise actions through the input system.\n\nNote: Defined controllers can look up the list of gestures and raise the events based on specific criteria.", MessageType.Info);

            if (MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.InputActionsProfile == null)
            {
                EditorGUILayout.HelpBox("No input actions found, please specify a input action profile in the main configuration.", MessageType.Error);
                return;
            }

            (target as BaseMixedRealityProfile).CheckProfileLock();

            serializedObject.Update();
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Windows Gesture Settings", EditorStyles.boldLabel);
            EditorGUILayout.PropertyField(windowsManipulationGestureSettings);
            EditorGUILayout.PropertyField(windowsNavigationGestureSettings);
            EditorGUILayout.PropertyField(useRailsNavigation);
            EditorGUILayout.PropertyField(windowsRailsNavigationGestures);
            EditorGUILayout.PropertyField(windowsGestureAutoStart);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Defined Recognizable Gestures", EditorStyles.boldLabel);
            RenderList(gestures);
            serializedObject.ApplyModifiedProperties();
        }
Пример #12
0
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            if (thisProfile.ParentProfile != null &&
                GUILayout.Button("Back to Configuration Profile"))
            {
                Selection.activeObject = thisProfile.ParentProfile;
            }

            thisProfile.CheckProfileLock();

            serializedObject.Update();

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Diagnostic Visualization Options", EditorStyles.boldLabel);
            EditorGUILayout.HelpBox("Diagnostic visualizations can help monitor system resources and performance inside an application.", MessageType.Info);

            EditorGUILayout.Space();
            showGeneralSettings = EditorGUILayout.Foldout(showGeneralSettings, "General Settings", true);
            if (showGeneralSettings)
            {
                using (new EditorGUI.IndentLevelScope())
                {
                    EditorGUILayout.PropertyField(showDiagnostics);
                    if (!showDiagnostics.boolValue)
                    {
                        EditorGUILayout.Space();
                        EditorGUILayout.HelpBox("Diagnostic visualizations have been globally disabled.", MessageType.Info);
                        EditorGUILayout.Space();
                    }
                }
            }

            EditorGUILayout.Space();
            showProfilerSettings = EditorGUILayout.Foldout(showProfilerSettings, "Profiler Settings", true);
            if (showProfilerSettings)
            {
                using (new EditorGUI.IndentLevelScope())
                {
                    EditorGUILayout.PropertyField(showProfiler);
                    EditorGUILayout.PropertyField(frameSampleRate);
                    EditorGUILayout.PropertyField(windowAnchor);
                    EditorGUILayout.PropertyField(windowOffset);
                    EditorGUILayout.PropertyField(windowScale);
                    EditorGUILayout.PropertyField(windowFollowSpeed);
                }
            }

            serializedObject.ApplyModifiedProperties();
        }
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();
            if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured())
            {
                return;
            }

            if (GUILayout.Button("Back to Configuration Profile"))
            {
                Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile;
            }

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Camera Profile", EditorStyles.boldLabel);
            EditorGUILayout.HelpBox("The Camera Profile helps tweak camera settings no matter what platform you're building for.", MessageType.Info);

            (target as BaseMixedRealityProfile).CheckProfileLock();

            serializedObject.Update();

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Global Settings:", EditorStyles.boldLabel);
            EditorGUILayout.PropertyField(isCameraPersistent);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Opaque Display Settings:", EditorStyles.boldLabel);
            EditorGUILayout.PropertyField(opaqueNearClip, nearClipTitle);
            EditorGUILayout.PropertyField(opaqueClearFlags, clearFlagsTitle);

            if ((CameraClearFlags)opaqueClearFlags.intValue == CameraClearFlags.Color)
            {
                opaqueBackgroundColor.colorValue = EditorGUILayout.ColorField("Background Color", opaqueBackgroundColor.colorValue);
            }

            opaqueQualityLevel.intValue = EditorGUILayout.Popup("Quality Setting", opaqueQualityLevel.intValue, QualitySettings.names);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Transparent Display Settings:", EditorStyles.boldLabel);
            EditorGUILayout.PropertyField(transparentNearClip, nearClipTitle);
            EditorGUILayout.PropertyField(transparentClearFlags, clearFlagsTitle);

            if ((CameraClearFlags)transparentClearFlags.intValue == CameraClearFlags.Color)
            {
                transparentBackgroundColor.colorValue = EditorGUILayout.ColorField("Background Color", transparentBackgroundColor.colorValue);
            }

            holoLensQualityLevel.intValue = EditorGUILayout.Popup("Quality Setting", holoLensQualityLevel.intValue, QualitySettings.names);

            serializedObject.ApplyModifiedProperties();
        }
        private void OnGUI()
        {
            using (new EditorGUILayout.VerticalScope())
            {
                MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

                using (new EditorGUILayout.HorizontalScope())
                {
                    GUILayout.FlexibleSpace();
                    EditorGUILayout.LabelField(FoundVersion ? $"Version {MRTKVersion}" : NotFoundMessage, EditorStyles.wordWrappedLabel);
                    GUILayout.FlexibleSpace();
                }
            }
        }
Пример #15
0
        private void DrawHeader()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            using (new EditorGUILayout.HorizontalScope())
            {
                EditorGUILayout.LabelField("Migration Window", EditorStyles.boldLabel);
                InspectorUIUtility.RenderDocumentationButton(MigrationWindowURL);
            }
            EditorGUILayout.LabelField(WindowDescription, EditorStyles.wordWrappedLabel);

            EditorGUILayout.Space();
            EditorGUILayout.Space();
        }
Пример #16
0
        private void OnGUI()
        {
            windowScrollPosition = EditorGUILayout.BeginScrollView(windowScrollPosition);

            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            // Render Title
            using (new EditorGUILayout.HorizontalScope())
            {
                EditorGUILayout.LabelField("Mixed Reality Toolkit Optimize Window", MixedRealityStylesUtility.BoldLargeTitleStyle);
                InspectorUIUtility.RenderDocumentationButton(OptimizeWindow_URL);
            }

            EditorGUILayout.LabelField("This tool automates the process of updating your project, currently open scene, and material assets to recommended settings for Mixed Reality", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();

            EditorGUILayout.LabelField("Active Build Target: ", EditorUserBuildSettings.activeBuildTarget.ToString());

            PerfTarget = (PerformanceTarget)EditorGUILayout.Popup("Performance Target", (int)this.PerfTarget, PerformanceTargetEnums);
            EditorGUILayout.HelpBox(PerformanceTargetDescriptions[(int)PerfTarget], MessageType.Info);
            EditorGUILayout.Space();

            if (!PlayerSettings.virtualRealitySupported)
            {
                EditorGUILayout.HelpBox("Virtual reality support is not enabled in player settings", MessageType.Error);
                if (GUILayout.Button("Enable Virtual Reality Support"))
                {
                    PlayerSettings.virtualRealitySupported = true;
                }
            }
            else
            {
                selectedToolbarIndex = GUILayout.Toolbar(selectedToolbarIndex, ToolbarTitles);
                if (selectedToolbarIndex == 0)
                {
                    RenderSettingOptimizations();
                }
                else if (selectedToolbarIndex == 1)
                {
                    RenderSceneOptimizations();
                }
                else
                {
                    RenderShaderOptimizations();
                }
            }

            EditorGUILayout.EndScrollView();
        }
        /// <summary>
        /// Render the Mixed Reality Toolkit Logo and search field.
        /// </summary>
        /// <returns>True if the rest of the inspector should be drawn.</returns>
        protected bool RenderMRTKLogoAndSearch()
        {
            // If we're being rendered as a sub profile, don't show the logo
            if (RenderAsSubProfile)
            {
                return(true);
            }

            if (MixedRealitySearchInspectorUtility.DrawSearchInterface(target))
            {
                return(false);
            }

            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();
            return(true);
        }
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured())
            {
                return;
            }

            if (GUILayout.Button("Back to Configuration Profile"))
            {
                Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile;
            }

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Input System Profile", EditorStyles.boldLabel);
            EditorGUILayout.HelpBox("The Input System Profile helps developers configure input no matter what platform you're building for.", MessageType.Info);

            (target as BaseMixedRealityProfile).CheckProfileLock();

            serializedObject.Update();
            bool changed = false;

            EditorGUI.BeginChangeCheck();
            EditorGUILayout.PropertyField(focusProviderType);

            if (EditorGUI.EndChangeCheck())
            {
                changed = true;
            }

            changed |= RenderProfile(inputActionsProfile);
            changed |= RenderProfile(inputActionRulesProfile);
            changed |= RenderProfile(pointerProfile);
            changed |= RenderProfile(gesturesProfile);
            changed |= RenderProfile(speechCommandsProfile);
            changed |= RenderProfile(controllerVisualizationProfile);
            changed |= RenderProfile(controllerDataProvidersProfile);
            changed |= RenderProfile(controllerMappingProfiles);

            serializedObject.ApplyModifiedProperties();

            if (changed)
            {
                EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetConfiguration(MixedRealityToolkit.Instance.ActiveProfile);
            }
        }
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured())
            {
                return;
            }

            if (!MixedRealityToolkit.Instance.ActiveProfile.IsInputSystemEnabled)
            {
                EditorGUILayout.HelpBox("No input system is enabled, or you need to specify the type in the main configuration profile.", MessageType.Error);

                if (GUILayout.Button("Back to Configuration Profile"))
                {
                    Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile;
                }

                return;
            }

            if (GUILayout.Button("Back to Input Profile"))
            {
                Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile;
            }

            (target as BaseMixedRealityProfile).CheckProfileLock();

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Speech Commands", EditorStyles.boldLabel);
            EditorGUILayout.HelpBox("Speech Commands are any/all spoken keywords your users will be able say to raise an Input Action in your application.", MessageType.Info);

            if (MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.InputActionsProfile == null)
            {
                EditorGUILayout.HelpBox("No input actions found, please specify a input action profile in the main configuration.", MessageType.Error);
                return;
            }

            serializedObject.Update();

            EditorGUILayout.PropertyField(recognizerStartBehaviour);
            EditorGUILayout.PropertyField(recognitionConfidenceLevel);

            RenderList(speechCommands);
            serializedObject.ApplyModifiedProperties();
        }
Пример #20
0
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();
            if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured())
            {
                return;
            }

            if (GUILayout.Button("Back to Input Profile"))
            {
                Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile;
            }

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Pointer Options", EditorStyles.boldLabel);
            EditorGUILayout.HelpBox("Pointers attach themselves onto controllers as they are initialized.", MessageType.Info);
            EditorGUILayout.Space();

            (target as BaseMixedRealityProfile).CheckProfileLock();
            serializedObject.Update();
            currentlySelectedPointerOption = -1;

            EditorGUILayout.PropertyField(pointingExtent);
            EditorGUILayout.PropertyField(pointingRaycastLayerMasks, true);
            EditorGUILayout.PropertyField(debugDrawPointingRays);
            EditorGUILayout.PropertyField(debugDrawPointingRayColors, true);

            EditorGUILayout.Space();
            EditorGUILayout.HelpBox("The gaze provider uses the default settings above, but further customization of the gaze can be done on the Gaze Provider.", MessageType.Info);

            EditorGUILayout.Space();
            EditorGUILayout.PropertyField(gazeCursorPrefab);
            EditorGUILayout.PropertyField(gazeProviderType);

            EditorGUILayout.Space();
            if (GUILayout.Button("Customize Gaze Provider Settings"))
            {
                Selection.activeObject = CameraCache.Main.gameObject;
            }

            EditorGUILayout.Space();
            pointerOptionList.DoLayoutList();
            serializedObject.ApplyModifiedProperties();
        }
        private void DrawHeader()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            using (new EditorGUILayout.HorizontalScope())
            {
                EditorGUILayout.LabelField("Migration Window", EditorStyles.boldLabel);
                InspectorUIUtility.RenderDocumentationButton(MigrationWindowURL);
            }
            EditorGUILayout.LabelField(WindowDescription, EditorStyles.wordWrappedLabel);

            // show a warning as long as we're not handling dependencies
            EditorGUILayout.HelpBox("Note that the migration window currently doesn't do dependency checks, " +
                                    "so overrides on prefab instances might be lost after choosing to upgrade. Create a local copy " +
                                    "or make sure to use version control before using the tool on game objects or scenes that are " +
                                    "using prefab overrides.", MessageType.Warning);

            EditorGUILayout.Space();
            EditorGUILayout.Space();
        }
Пример #22
0
        protected void RenderHeader(string infoBoxText = "", Texture2D image = null)
        {
            if (!image.IsNull() ||
                !string.IsNullOrWhiteSpace(infoBoxText))
            {
                isOverrideHeader = true;
            }
            else
            {
                if (isOverrideHeader)
                {
                    return;
                }
            }

            if (image.IsNull())
            {
                MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();
            }
            else
            {
                MixedRealityInspectorUtility.RenderInspectorHeader(image);
            }

            if (!ThisProfile.ParentProfile.IsNull() &&
                GUILayout.Button("Back to parent profile"))
            {
                Selection.activeObject = ThisProfile.ParentProfile;
            }

            EditorGUILayout.Space();
            EditorGUILayout.LabelField($"{ThisProfile.name.ToProperCase()} Settings", EditorStyles.boldLabel);

            if (isOverrideHeader)
            {
                EditorGUILayout.HelpBox(infoBoxText, MessageType.Info);
            }

            EditorGUILayout.Space();
        }
Пример #23
0
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured())
            {
                return;
            }

            if (GUILayout.Button("Back to Configuration Profile"))
            {
                Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile;
            }

            (target as BaseMixedRealityProfile).CheckProfileLock();

            serializedObject.Update();

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Diagnostic Visualization Options", EditorStyles.boldLabel);
            EditorGUILayout.HelpBox("Diagnostic visualizations can help monitor system resources and performance inside an application.", MessageType.Info);
            EditorGUILayout.Space();

            EditorGUILayout.PropertyField(visible);
            EditorGUILayout.Space();

            EditorGUILayout.PropertyField(handlerType);
            EditorGUILayout.Space();

            EditorGUILayout.PropertyField(showCpu);
            EditorGUILayout.PropertyField(cpuBuffer);
            EditorGUILayout.PropertyField(showFps);
            EditorGUILayout.PropertyField(fpsBuffer);
            EditorGUILayout.PropertyField(showMemory);
            EditorGUILayout.PropertyField(memoryBuffer);

            serializedObject.ApplyModifiedProperties();
        }
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured())
            {
                return;
            }

            if (!MixedRealityToolkit.Instance.ActiveProfile.IsInputSystemEnabled)
            {
                EditorGUILayout.HelpBox("No input system is enabled, or you need to specify the type in the main configuration profile.", MessageType.Error);

                if (GUILayout.Button("Back to Configuration Profile"))
                {
                    Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile;
                }

                return;
            }

            if (GUILayout.Button("Back to Input Profile"))
            {
                Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile;
            }

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Input Actions", EditorStyles.boldLabel);

            EditorGUILayout.HelpBox("Input Actions are any/all actions your users will be able to make when interacting with your application.\n\n" +
                                    "After defining all your actions, you can then wire up these actions to hardware sensors, controllers, and other input devices.", MessageType.Info);

            (target as BaseMixedRealityProfile).CheckProfileLock();

            serializedObject.Update();
            RenderList(inputActionList);
            serializedObject.ApplyModifiedProperties();
        }
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            if (thisProfile.ParentProfile != null &&
                GUILayout.Button("Back to Input Profile"))
            {
                Selection.activeObject = thisProfile.ParentProfile;
            }

            thisProfile.CheckProfileLock();

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Input Actions", EditorStyles.boldLabel);

            EditorGUILayout.HelpBox("Input Actions are any/all actions your users will be able to make when interacting with your application.\n\n" +
                                    "After defining all your actions, you can then wire up these actions to hardware sensors, controllers, and other input devices.", MessageType.Info);

            thisProfile.CheckProfileLock();

            serializedObject.Update();
            RenderList(inputActionList);
            serializedObject.ApplyModifiedProperties();
        }
Пример #26
0
        private void OnGUI()
        {
            windowScrollPosition = EditorGUILayout.BeginScrollView(windowScrollPosition);

            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            // Render Title
            EditorGUILayout.LabelField("Mixed Reality Toolkit Optimize Window", BoldLargeTitle);
            EditorGUILayout.LabelField("This tool automates the process of updating your project, currently open scene, and material assets to recommended settings for Mixed Reality", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();

            PerfTarget = (PerformanceTarget)EditorGUILayout.Popup("Performance Target", (int)this.PerfTarget, PerformanceTargetEnums);
            EditorGUILayout.HelpBox(PerformanceTargetDescriptions[(int)PerfTarget], MessageType.Info);
            EditorGUILayout.Space();

            if (!PlayerSettings.virtualRealitySupported)
            {
                EditorGUILayout.HelpBox("Current build target does not have virtual reality support enabled", MessageType.Warning);
            }

            selectedToolbarIndex = GUILayout.Toolbar(selectedToolbarIndex, ToolbarTitles);
            if (selectedToolbarIndex == 0)
            {
                RenderProjectOptimizations();
            }
            else if (selectedToolbarIndex == 1)
            {
                RenderSceneOptimizations();
            }
            else
            {
                RenderShaderOptimizations();
            }

            EditorGUILayout.EndScrollView();
        }
Пример #27
0
        private void OnGUI()
        {
            centeredStyle = new GUIStyle(GUI.skin.GetStyle("Label"))
            {
                alignment = TextAnchor.UpperCenter,
                wordWrap  = true
            };

            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            using (new EditorGUILayout.HorizontalScope())
            {
                EditorGUILayout.LabelField("Search: ", GUILayout.MaxWidth(70));
                searchString = EditorGUILayout.TextField(searchString, GUILayout.ExpandWidth(true));

                if (GUILayout.Button("Clear", EditorStyles.miniButton, GUILayout.MaxWidth(50)))
                {
                    searchString = string.Empty;
                }

                SessionState.SetString(SearchDisplaySearchFieldKey, searchString);
            }

            using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox))
            {
                using (var scrollView = new EditorGUILayout.ScrollViewScope(scrollPos, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true)))
                {
                    scrollPos = scrollView.scrollPosition;

                    foreach (var bucket in ToolboxPrefabs)
                    {
                        RenderSection(bucket);
                    }
                }
            }
        }
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured())
            {
                return;
            }

            if (GUILayout.Button("Back to Configuration Profile"))
            {
                Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile;
            }

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Registered Service Providers Profile", EditorStyles.boldLabel);
            EditorGUILayout.HelpBox("This profile defines any additional Services like systems, features, and managers to register with the Mixed Reality Toolkit.", MessageType.Info);

            (target as BaseMixedRealityProfile).CheckProfileLock();

            serializedObject.Update();
            RenderList(configurations);
            serializedObject.ApplyModifiedProperties();
        }
Пример #29
0
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            serializedObject.Update();
            EditorGUI.BeginChangeCheck();
            EditorGUILayout.LabelField(new GUIContent("Mixed Reality Toolkit Root Profile", "This profile is the main root configuration for the entire XRTK."));

            if (activeProfile.objectReferenceValue != null)
            {
                EditorGUILayout.PropertyField(activeProfile, GUIContent.none);
            }
            else
            {
                if (GUILayout.Button("Create a new root profile"))
                {
                    var rootProfile = CreateInstance <MixedRealityToolkitRootProfile>().GetOrCreateAsset();
                    activeProfile.objectReferenceValue = rootProfile;
                }
            }

            var changed      = EditorGUI.EndChangeCheck();
            var commandName  = Event.current.commandName;
            var rootProfiles = ScriptableObjectExtensions.GetAllInstances <MixedRealityToolkitRootProfile>();

            if (activeProfile.objectReferenceValue.IsNull() &&
                currentPickerWindow == -1 && checkChange)
            {
                switch (rootProfiles.Length)
                {
                case 0:
                    EditorGUIUtility.PingObject(target);
                    EditorUtility.DisplayDialog("Attention!", "No root profile for the Mixed Reality Toolkit was found.\n\nYou'll need to create a new one.", "OK");
                    break;

                case 1:
                    var rootProfilePath = AssetDatabase.GetAssetPath(rootProfiles[0]);

                    EditorApplication.delayCall += () =>
                    {
                        changed = true;
                        var rootProfile = AssetDatabase.LoadAssetAtPath <MixedRealityToolkitRootProfile>(rootProfilePath);
                        Debug.Assert(rootProfile != null);
                        activeProfile.objectReferenceValue = rootProfile;
                        EditorGUIUtility.PingObject(rootProfile);
                        Selection.activeObject = rootProfile;
                        MixedRealityToolkit.Instance.ResetProfile(rootProfile);
                    };
                    break;

                default:
                    EditorUtility.DisplayDialog("Attention!", "You must choose a profile for the Mixed Reality Toolkit.", "OK");
                    currentPickerWindow = GUIUtility.GetControlID(FocusType.Passive);
                    EditorGUIUtility.ShowObjectPicker <MixedRealityToolkitRootProfile>(null, false, string.Empty, currentPickerWindow);
                    break;
                }

                checkChange = false;
            }

            if (EditorGUIUtility.GetObjectPickerControlID() == currentPickerWindow)
            {
                switch (commandName)
                {
                case "ObjectSelectorUpdated":
                    activeProfile.objectReferenceValue = EditorGUIUtility.GetObjectPickerObject();
                    changed = true;
                    break;

                case "ObjectSelectorClosed":
                    activeProfile.objectReferenceValue = EditorGUIUtility.GetObjectPickerObject();
                    currentPickerWindow          = -1;
                    changed                      = true;
                    EditorApplication.delayCall += () =>
                    {
                        EditorGUIUtility.PingObject(activeProfile.objectReferenceValue);
                        Selection.activeObject = activeProfile.objectReferenceValue;
                    };
                    break;
                }
            }

            if (activeProfile.objectReferenceValue != null)
            {
                var rootProfile      = activeProfile.objectReferenceValue as MixedRealityToolkitRootProfile;
                var profileInspector = CreateEditor(rootProfile);

                if (profileInspector is MixedRealityToolkitRootProfileInspector rootProfileInspector)
                {
                    EditorGUILayout.Space();
                    EditorGUILayout.Space();
                    EditorGUILayout.Space();
                    Rect rect = new Rect(GUILayoutUtility.GetLastRect())
                    {
                        height = 0.75f
                    };
                    EditorGUI.DrawRect(rect, Color.gray);
                    EditorGUILayout.Space();

                    rootProfileInspector.RenderSystemFields();
                }
            }

            serializedObject.ApplyModifiedProperties();

            if (changed)
            {
                EditorApplication.delayCall += () => MixedRealityToolkit.Instance.ResetProfile((MixedRealityToolkitRootProfile)activeProfile.objectReferenceValue);
            }
        }
Пример #30
0
        public override void OnInspectorGUI()
        {
            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            if (!MixedRealityInspectorUtility.CheckMixedRealityConfigured())
            {
                return;
            }

            if (!MixedRealityToolkit.Instance.ActiveProfile.IsInputSystemEnabled)
            {
                EditorGUILayout.HelpBox("No input system is enabled, or you need to specify the type in the main configuration profile.", MessageType.Error);

                if (GUILayout.Button("Back to Configuration Profile"))
                {
                    Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile;
                }

                return;
            }

            if (MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.InputActionsProfile == null)
            {
                EditorGUILayout.HelpBox("No Input Actions profile was specified.", MessageType.Error);

                if (GUILayout.Button("Back to Input Profile"))
                {
                    Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile;
                }

                return;
            }

            if (GUILayout.Button("Back to Input Profile"))
            {
                Selection.activeObject = MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile;
            }

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Input Action Rules Profile", EditorStyles.boldLabel);
            EditorGUILayout.HelpBox("Input Action Rules help define alternative Actions that will be raised based on specific criteria.\n\n" +
                                    "You can create new rules by assigning a base Input Action below, then assigning the criteria you'd like to meet. When the criteria is met, the Rule's Action will be raised with the criteria value.\n\n" +
                                    "Note: Rules can only be created for the same axis constraints.", MessageType.Info);

            EditorGUILayout.Space();

            (target as BaseMixedRealityProfile).CheckProfileLock();

            var isGuiLocked = !(MixedRealityPreferences.LockProfiles && !((BaseMixedRealityProfile)target).IsCustomProfile);

            GUI.enabled = isGuiLocked;

            serializedObject.Update();

            selectedBaseActionId = RenderBaseInputAction(selectedBaseActionId, out currentBaseAction);
            GUI.enabled          = isGuiLocked && currentBaseAction != MixedRealityInputAction.None;
            RenderCriteriaField(currentBaseAction);

            if (selectedBaseActionId == selectedRuleActionId)
            {
                selectedRuleActionId = 0;
            }

            selectedRuleActionId = RenderRuleInputAction(selectedRuleActionId, out currentRuleAction);

            EditorGUILayout.Space();

            GUI.enabled = isGuiLocked &&
                          !RuleExists() &&
                          currentBaseAction != MixedRealityInputAction.None &&
                          currentRuleAction != MixedRealityInputAction.None &&
                          currentBaseAction.AxisConstraint != AxisType.None &&
                          currentBaseAction.AxisConstraint != AxisType.Raw;

            if (GUILayout.Button(RuleAddButtonContent, EditorStyles.miniButton))
            {
                AddRule();
                ResetCriteria();
            }

            GUI.enabled = isGuiLocked;

            EditorGUILayout.Space();

            var isWideMode = EditorGUIUtility.wideMode;

            EditorGUIUtility.wideMode = true;

            RenderList(inputActionRulesDigital, digitalFoldouts);
            RenderList(inputActionRulesSingleAxis, singleAxisFoldouts);
            RenderList(inputActionRulesDualAxis, dualAxisFoldouts);
            RenderList(inputActionRulesVectorAxis, vectorFoldouts);
            RenderList(inputActionRulesQuaternionAxis, quaternionFoldouts);
            RenderList(inputActionRulesPoseAxis, poseFoldouts);

            EditorGUIUtility.wideMode = isWideMode;
            serializedObject.ApplyModifiedProperties();
        }