private void DrawSelectNameAndPlatform() { EditorGUILayout.Space(); EditorGUILayout.HelpBox("This wizard will help you set up and register a simple extension service. MRTK Services are similar to traditional MonoBehaviour singletons but with more robust access and lifecycle control. Scripts can access services through the MRTK's service provider interface. For more information about services, click the link below.", MessageType.Info); using (new EditorGUILayout.HorizontalScope()) { GUILayout.FlexibleSpace(); InspectorUIUtility.RenderDocumentationButton(servicesDocumentationURL); GUILayout.FlexibleSpace(); } EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Choose a name for your service.", EditorStyles.miniLabel); creator.ServiceName = EditorGUILayout.TextField("Service Name", creator.ServiceName); creator.ValidateName(errors); EditorGUILayout.Space(); EditorGUILayout.LabelField("Choose which platforms your service will support.", EditorStyles.miniLabel); creator.Platforms = (SupportedPlatforms)EditorGUILayout.EnumFlagsField("Platforms", creator.Platforms); creator.ValidatePlatforms(errors); EditorGUILayout.Space(); EditorGUILayout.LabelField("Choose a namespace for your service.", EditorStyles.miniLabel); creator.Namespace = EditorGUILayout.TextField("Namespace", creator.Namespace); creator.ValidateNamespace(errors); EditorGUILayout.Space(); bool hasErrors = errors.Count > 0; if (hasErrors) { RenderErrorLog(); } using (new EditorGUI.DisabledGroupScope(hasErrors)) { if (GUILayout.Button("Next")) { creator.Stage = ExtensionServiceCreator.CreationStage.ChooseOutputFolders; creator.StoreState(); } } }
private void DrawSelectNameAndPlatform() { EditorGUILayout.Space(); EditorGUILayout.HelpBox("This wizard will help you set up and register a simple extension service. MRTK Services are similar to traditional Monobehaviour singletons but with more robust access and lifecycle control. Scripts can access services through the MRTK's service provider interface. For more information about services, click the link below.", MessageType.Info); GUIContent buttonContent = new GUIContent(); buttonContent.image = EditorGUIUtility.IconContent("_Help").image; buttonContent.text = " Services Documentation"; buttonContent.tooltip = servicesDocumentationURL; using (new EditorGUILayout.HorizontalScope()) { GUILayout.FlexibleSpace(); if (GUILayout.Button(buttonContent, GUILayout.MaxWidth(docLinkWidth))) { Application.OpenURL(servicesDocumentationURL); } GUILayout.FlexibleSpace(); } EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Choose a name for your service.", EditorStyles.miniLabel); creator.ServiceName = EditorGUILayout.TextField("Service Name", creator.ServiceName); bool readyToProgress = creator.ValidateName(errors); foreach (string error in errors) { EditorGUILayout.HelpBox(error, MessageType.Error); } EditorGUILayout.Space(); EditorGUILayout.LabelField("Choose which platforms your service will support.", EditorStyles.miniLabel); creator.Platforms = (SupportedPlatforms)EditorGUILayout.EnumFlagsField("Platforms", creator.Platforms); readyToProgress &= creator.ValidatePlatforms(errors); foreach (string error in errors) { EditorGUILayout.HelpBox(error, MessageType.Error); } EditorGUILayout.Space(); EditorGUILayout.LabelField("Choose a namespace for your service.", EditorStyles.miniLabel); creator.Namespace = EditorGUILayout.TextField("Namespace", creator.Namespace); readyToProgress &= creator.ValidateNamespace(errors); foreach (string error in errors) { EditorGUILayout.HelpBox(error, MessageType.Error); } EditorGUILayout.Space(); GUI.color = readyToProgress ? enabledColor : disabledColor; if (GUILayout.Button("Next") && readyToProgress) { creator.Stage = ExtensionServiceCreator.CreationStage.ChooseOutputFolders; creator.StoreState(); } }