void DrawLeftPane() { HGUIToolbar.Begin(); if (HGUIToolbar.Button(EditorIcon.refresh)) { Refresh(); EditorHelper.ShowMessagePop("Refresh OK."); } bool isDirty = m_treeView.m_asmdefItems.Where(x => x.isDIRTY).Count() != 0; ScopeDisable.Begin(!isDirty); if (HGUIToolbar.Button("Apply All")) { m_treeView.SaveAssetDirty(); } ScopeDisable.End(); if (HGUIToolbar.DropDown("Change Format")) { var m = new GenericMenu(); m.AddItem("Assembly Name", () => m_treeView.ChangeAsmName()); m.AddItem("GUID", () => m_treeView.ChangeGUID()); m.DropDownPopupRect(HEditorGUI.lastRect); // } GUILayout.FlexibleSpace(); HGUIToolbar.End(); m_treeView.DrawLayoutGUI(); }
void DrawRightPane() { HGUIToolbar.Begin(); if (HGUIToolbar.Button("ソースコード整形")) { ShellUtils.Start("dotnet-format", $"-v diag {m_treeView.currentItem.m_json.name}.csproj"); } //GUILayout.Space(1); GUILayout.FlexibleSpace(); if (HGUIToolbar.Button("Sort")) { m_treeView.Sort(m_treeView.currentItem); } ScopeDisable.Begin(m_treeView.currentItem == null ? true : !m_treeView.currentItem.isDIRTY); if (HGUIToolbar.Button("Apply")) { m_treeView.ApplyAndSave(m_treeView.currentItem); } ScopeDisable.End(); HGUIToolbar.End(); using (var sc = new GUILayout.ScrollViewScope(m_scroll)) { m_scroll = sc.scrollPosition; m_treeView.DrawItem(); } }
public static void PreviewFolder(/* string label, */ string path, Action presetAction = null) { ScopeHorizontal.Begin(EditorStyles.helpBox); GUILayout.Label(path); GUILayout.FlexibleSpace(); if (presetAction != null) { if (IconButton(EditorIcon.preset_context)) { presetAction.Invoke(); } } ScopeDisable.Begin(!path.IsExistsDirectory()); if (IconButton(EditorIcon.icons_processed_folderempty_icon_asset)) { ShellUtils.OpenDirectory(path); } ScopeDisable.End(); ScopeHorizontal.End(); }
public override void OnDefaultGUI() { E.Load(); ScopeDisable.BeginIsCompiling(); DrawToolBar(); UnityEditorSplitterGUILayout.BeginHorizontalSplit(m_HorizontalSplitter); ScopeVertical.Begin(); DrawLeftPane(); ScopeVertical.End(); ScopeVertical.Begin(HEditorStyles.dopesheetBackground); DrawRightPane(); ScopeVertical.End(); UnityEditorSplitterGUILayout.EndHorizontalSplit(); ScopeDisable.End(); if (EditorApplication.isCompiling) { var rc = position; rc.x = rc.y = 0; GUI.Label(rc.AlignCenter(100, 20), EditorHelper.TempContent($"コンパイル中", m_waitSpinIcon), GUI.skin.box); } }