public override void OnGUI(string searchContext) { using (new LabeledScope(Styles.SourceGenerationLabel)) { EditorGUI.BeginChangeCheck(); _generateSetting.@namespace = EditorGUILayout.TextField(new GUIContent("Namespace"), _generateSetting.@namespace); _generateSetting.outputDir = EditorGUILayout.TextField(new GUIContent("Output Directory"), _generateSetting.outputDir); using (new LabeledScope(Styles.GenerateTargetsLabel)) { _generateSetting.generateSceneValues = EditorGUILayout.Toggle(new GUIContent("Scene"), _generateSetting.generateSceneValues); _generateSetting.generateSortingLayerValues = EditorGUILayout.Toggle(new GUIContent("SortingLayer"), _generateSetting.generateSortingLayerValues); _generateSetting.generateLayerValues = EditorGUILayout.Toggle(new GUIContent("Layer"), _generateSetting.generateLayerValues); _generateSetting.generateTagValues = EditorGUILayout.Toggle(new GUIContent("Tag"), _generateSetting.generateTagValues); } EditorGUILayout.Space(); if (EditorGUI.EndChangeCheck()) { UnityConstantsGeneratorSettings.Save(); } if (GUILayout.Button("Generate", EditorStyles.miniButtonRight)) { using (AssetEditing.Scope()) { UnityConstantValuesGenerator.UpdateUnityConstants(); UnityConstantValuesGenerator.UpdateSceneValues(); } AssetDatabase.Refresh(); } } }
UnityConstantsGeneratorSettings() { _instance = this; }