Update editor window

pull/9/head
hevinci 2022-04-28 22:45:28 +08:00
parent 636fbed7f2
commit 6070e619da
3 changed files with 5 additions and 7 deletions

View File

@ -1,7 +1,7 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True"> <ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
<uie:Toolbar name="Toolbar" style="display: flex;"> <uie:Toolbar name="Toolbar" style="display: flex;">
<uie:ToolbarButton text="刷新" display-tooltip-when-elided="true" name="SampleButton" style="width: 70px; background-color: rgb(15, 118, 31); -unity-text-align: middle-center; border-top-left-radius: 2px; border-bottom-left-radius: 2px; border-top-right-radius: 2px; border-bottom-right-radius: 2px; border-left-width: 1px; border-right-width: 1px;" />
<uie:ToolbarMenu display-tooltip-when-elided="true" name="ViewModeMenu" text="ViewMode" style="width: 100px; flex-grow: 0;" /> <uie:ToolbarMenu display-tooltip-when-elided="true" name="ViewModeMenu" text="ViewMode" style="width: 100px; flex-grow: 0;" />
<uie:ToolbarSearchField focusable="true" name="SearchField" style="flex-grow: 1;" /> <uie:ToolbarSearchField focusable="true" name="SearchField" style="flex-grow: 1;" />
<uie:ToolbarButton text="刷新" display-tooltip-when-elided="true" name="SampleButton" style="width: 70px; background-color: rgb(15, 118, 31); -unity-text-align: middle-center; border-top-left-radius: 2px; border-bottom-left-radius: 2px; border-top-right-radius: 2px; border-bottom-right-radius: 2px; border-left-width: 1px; border-right-width: 1px;" />
</uie:Toolbar> </uie:Toolbar>
</ui:UXML> </ui:UXML>

View File

@ -101,7 +101,7 @@ namespace YooAsset.Editor
// 分组容器 // 分组容器
_grouperContainer = root.Q("GrouperContainer"); _grouperContainer = root.Q("GrouperContainer");
// 分组信息相关 // 分组名称
_grouperNameTxt = root.Q<TextField>("GrouperName"); _grouperNameTxt = root.Q<TextField>("GrouperName");
_grouperNameTxt.RegisterValueChangedCallback(evt => _grouperNameTxt.RegisterValueChangedCallback(evt =>
{ {
@ -113,6 +113,7 @@ namespace YooAsset.Editor
} }
}); });
// 分组备注
_grouperDescTxt = root.Q<TextField>("GrouperDesc"); _grouperDescTxt = root.Q<TextField>("GrouperDesc");
_grouperDescTxt.RegisterValueChangedCallback(evt => _grouperDescTxt.RegisterValueChangedCallback(evt =>
{ {
@ -124,6 +125,7 @@ namespace YooAsset.Editor
} }
}); });
// 分组的资源标签
_grouperAssetTagsTxt = root.Q<TextField>("GrouperAssetTags"); _grouperAssetTagsTxt = root.Q<TextField>("GrouperAssetTags");
_grouperAssetTagsTxt.RegisterValueChangedCallback(evt => _grouperAssetTagsTxt.RegisterValueChangedCallback(evt =>
{ {
@ -161,7 +163,6 @@ namespace YooAsset.Editor
AssetBundleGrouperSettingData.SaveFile(); AssetBundleGrouperSettingData.SaveFile();
} }
// 刷新窗体
private void RefreshWindow() private void RefreshWindow()
{ {
_enableAddressableToogle.SetValueWithoutNotify(AssetBundleGrouperSettingData.Setting.EnableAddressable); _enableAddressableToogle.SetValueWithoutNotify(AssetBundleGrouperSettingData.Setting.EnableAddressable);
@ -172,8 +173,6 @@ namespace YooAsset.Editor
FillGrouperViewData(); FillGrouperViewData();
} }
// 导入导出按钮
private void ExportBtn_clicked() private void ExportBtn_clicked()
{ {
string resultPath = EditorTools.OpenFolderPanel("Export XML", "Assets/"); string resultPath = EditorTools.OpenFolderPanel("Export XML", "Assets/");

View File

@ -1,6 +1,5 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True"> <ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
<uie:Toolbar name="Toolbar" style="display: flex;"> <uie:Toolbar name="Toolbar" style="display: flex; flex-direction: row-reverse;">
<uie:ToolbarSearchField focusable="true" name="SearchField" style="width: 300px; flex-grow: 1;" />
<ui:Button text="导出" display-tooltip-when-elided="true" name="ExportButton" style="width: 50px; background-color: rgb(56, 147, 58);" /> <ui:Button text="导出" display-tooltip-when-elided="true" name="ExportButton" style="width: 50px; background-color: rgb(56, 147, 58);" />
<ui:Button text="导入" display-tooltip-when-elided="true" name="ImportButton" style="width: 50px; background-color: rgb(56, 147, 58);" /> <ui:Button text="导入" display-tooltip-when-elided="true" name="ImportButton" style="width: 50px; background-color: rgb(56, 147, 58);" />
</uie:Toolbar> </uie:Toolbar>