public override void OnInspectorGUI() { var config = this.target as UIManConfig; if (this.namespaceField == null || this.screenPath == null || this.dialogPath == null || this.bgPath == null) { this.namespaceField = new TextFieldHelper(config.classNamespace); this.screenPath = new PathBrowser(config.screenPrefabFolder, Application.dataPath); this.dialogPath = new PathBrowser(config.dialogPrefabFolder, Application.dataPath); this.bgPath = new PathBrowser(config.backgroundRootFolder, Application.dataPath); this.animPath = new PathBrowser(config.animRootFolder, Application.dataPath); } LabelHelper.TitleLabel("UIMan Configuration"); LineHelper.Draw(Color.blue); EditorGUILayout.Space(); GUILayout.BeginVertical("Box"); config.classNamespace = this.namespaceField.Draw(this.namespaceGUI); config.screenPrefabFolder = this.screenPath.Draw(this.screenGUI); config.dialogPrefabFolder = this.dialogPath.Draw(this.dialogGUI); config.backgroundRootFolder = this.bgPath.Draw(this.bgGUI); config.animRootFolder = this.animPath.Draw(this.animRootGUI); GUILayout.EndVertical(); GUILayout.BeginHorizontal("Box"); GUILayout.Label("<b>Warning:</b> This configuration use to set default path of prefabs/images for UI, destination folder must be child of Unity's Resources folder.\n\n" + "If you don't want to use this default path for your Screen/Dialog, apply UIDescriptor to your class to define custom path.", EditorGUIHelper.RichText(true)); GUILayout.EndHorizontal(); EditorUtility.SetDirty(this.target); }
public override void OnInspectorGUI() { UIManConfig config = target as UIManConfig; if (screenPath == null || dialogPath == null || bgPath == null) { screenPath = new PathBrowser(config.screenPrefabFolder, rootUrl); dialogPath = new PathBrowser(config.dialogPrefabFolder, rootUrl); bgPath = new PathBrowser(config.backgroundRootFolder, rootUrl); } LabelHelper.TitleLabel("UIMan Configuration"); LineHelper.Draw(Color.blue); EditorGUILayout.Space(); GUILayout.BeginVertical("Box"); config.screenPrefabFolder = screenPath.Draw(screenGUI); config.dialogPrefabFolder = dialogPath.Draw(dialogGUI); config.backgroundRootFolder = bgPath.Draw(bgGUI); GUILayout.EndVertical(); GUILayout.BeginHorizontal("Box"); GUILayout.Label("<b>Warning:</b> This configuration use to set default path of prefabs/images for UI, destination folder must be child of Unity's Resources folder.\n\n" + "If you don't want to use this default path for your Screen/Dialog, apply UIDescriptor to your class to define custom path.", EditorGUIHelper.RichText(true)); GUILayout.EndHorizontal(); EditorUtility.SetDirty(target); }