private void OnGUI() { using (var horizon = new GUILayout.HorizontalScope()) { if (GUILayout.Button(new GUIContent("Open with Unity Doc Generator", "Open Unity Doc Generator for more detail settings"))) { DocGeneratorWindow.OpenWindow(); DocGeneratorWindow.currentSelectPath = packagePath; } string p1 = System.IO.Path.Combine(packagePath, DocGeneratorWindow.settingFile); string p2 = System.IO.Path.Combine(packagePath, DocGeneratorWindow.DocFxProject); bool isSettingExsit = System.IO.File.Exists(p1); bool isDocFxDocumentExsit = System.IO.Directory.Exists(p2); bool buildDirectAvailable = !(isSettingExsit && isDocFxDocumentExsit); using (var disable = new EditorGUI.DisabledGroupScope(buildDirectAvailable)) { if (GUILayout.Button(new GUIContent("Generate Doc with last setting", "Require the package has generate document using UnityDocGenerator before"))) { DocGeneratorWindow.OpenWindow(); DocGeneratorWindow.currentSelectPath = System.IO.Path.GetFullPath(packageInfo.assetPath); DocGeneratorWindow.Instance.Docfx(); } } } }
public static void OpenWindow() { Instance = GetWindow <DocGeneratorWindow>(); Instance.titleContent = new GUIContent("UnityDocGenerator"); Instance.minSize = new Vector2(600, 400); }