예제 #1
0
        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();
        }
예제 #2
0
        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();
            }
        }