mirror of https://github.com/tuyoogame/YooAsset
parent
365ed560f6
commit
4da2bf441f
|
@ -13,5 +13,10 @@ namespace YooAsset.Editor
|
||||||
/// 收集的包裹名称
|
/// 收集的包裹名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string CollectPackage = string.Empty;
|
public string CollectPackage = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 容器值
|
||||||
|
/// </summary>
|
||||||
|
public int ProcessCapacity = 1000;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -24,6 +24,7 @@ namespace YooAsset.Editor
|
||||||
private TextField _collectOutputField;
|
private TextField _collectOutputField;
|
||||||
private Label _currentShaderCountField;
|
private Label _currentShaderCountField;
|
||||||
private Label _currentVariantCountField;
|
private Label _currentVariantCountField;
|
||||||
|
private SliderInt _processCapacitySlider;
|
||||||
private PopupField<string> _packageField;
|
private PopupField<string> _packageField;
|
||||||
|
|
||||||
public void CreateGUI()
|
public void CreateGUI()
|
||||||
|
@ -72,6 +73,23 @@ namespace YooAsset.Editor
|
||||||
packageContainer.Add(_packageField);
|
packageContainer.Add(_packageField);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 容器值
|
||||||
|
_processCapacitySlider = root.Q<SliderInt>("ProcessCapacity");
|
||||||
|
_processCapacitySlider.SetValueWithoutNotify(ShaderVariantCollectorSettingData.Setting.ProcessCapacity);
|
||||||
|
#if !UNITY_2020_3_OR_NEWER
|
||||||
|
_processCapacitySlider.label = $"Capacity ({_processCapacitySlider.value})";
|
||||||
|
_processCapacitySlider.RegisterValueChangedCallback(evt =>
|
||||||
|
{
|
||||||
|
ShaderVariantCollectorSettingData.Setting.ProcessCapacity = _processCapacitySlider.value;
|
||||||
|
_processCapacitySlider.label = $"Capacity ({_processCapacitySlider.value})";
|
||||||
|
});
|
||||||
|
#else
|
||||||
|
_processCapacitySlider.RegisterValueChangedCallback(evt =>
|
||||||
|
{
|
||||||
|
ShaderVariantCollectorSettingData.Setting.ProcessCapacity = _processCapacitySlider.value;
|
||||||
|
});
|
||||||
|
#endif
|
||||||
|
|
||||||
_currentShaderCountField = root.Q<Label>("CurrentShaderCount");
|
_currentShaderCountField = root.Q<Label>("CurrentShaderCount");
|
||||||
_currentVariantCountField = root.Q<Label>("CurrentVariantCount");
|
_currentVariantCountField = root.Q<Label>("CurrentVariantCount");
|
||||||
|
|
||||||
|
@ -103,7 +121,8 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
string savePath = ShaderVariantCollectorSettingData.Setting.SavePath;
|
string savePath = ShaderVariantCollectorSettingData.Setting.SavePath;
|
||||||
string packageName = ShaderVariantCollectorSettingData.Setting.CollectPackage;
|
string packageName = ShaderVariantCollectorSettingData.Setting.CollectPackage;
|
||||||
ShaderVariantCollector.Run(savePath, packageName, int.MaxValue, null);
|
int processCapacity = _processCapacitySlider.value;
|
||||||
|
ShaderVariantCollector.Run(savePath, packageName, processCapacity, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 构建包裹相关
|
// 构建包裹相关
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements">
|
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
|
||||||
<uie:Toolbar name="Toolbar" style="display: flex; flex-direction: row-reverse;" />
|
|
||||||
<ui:VisualElement name="CollectContainer">
|
<ui:VisualElement name="CollectContainer">
|
||||||
<ui:TextField picking-mode="Ignore" label="文件保存路径" name="CollectOutput" style="height: 22px;" />
|
<ui:TextField picking-mode="Ignore" label="文件保存路径" name="CollectOutput" style="height: 22px;" />
|
||||||
<ui:VisualElement name="PackageContainer" style="height: 24px;" />
|
<ui:VisualElement name="PackageContainer" style="height: 24px;">
|
||||||
|
<uie:Toolbar name="Toolbar" style="display: flex; flex-direction: row-reverse;" />
|
||||||
|
</ui:VisualElement>
|
||||||
<ui:Label text="Current Shader Count" display-tooltip-when-elided="true" name="CurrentShaderCount" style="height: 20px; padding-left: 4px;" />
|
<ui:Label text="Current Shader Count" display-tooltip-when-elided="true" name="CurrentShaderCount" style="height: 20px; padding-left: 4px;" />
|
||||||
<ui:Label text="Current Variant Count" display-tooltip-when-elided="true" name="CurrentVariantCount" style="height: 20px; padding-left: 4px;" />
|
<ui:Label text="Current Variant Count" display-tooltip-when-elided="true" name="CurrentVariantCount" style="height: 20px; padding-left: 4px;" />
|
||||||
|
<ui:SliderInt picking-mode="Ignore" label="Capacity" value="9999" high-value="1000" name="ProcessCapacity" low-value="10" show-input-field="true" />
|
||||||
<ui:Button text="开始搜集" display-tooltip-when-elided="true" name="CollectButton" style="height: 50px; background-color: rgb(40, 106, 42); margin-top: 10px;" />
|
<ui:Button text="开始搜集" display-tooltip-when-elided="true" name="CollectButton" style="height: 50px; background-color: rgb(40, 106, 42); margin-top: 10px;" />
|
||||||
</ui:VisualElement>
|
</ui:VisualElement>
|
||||||
</ui:UXML>
|
</ui:UXML>
|
||||||
|
|
Loading…
Reference in New Issue