From 4da2bf441f849eb0f803fdda90fa221af4ff40c2 Mon Sep 17 00:00:00 2001 From: hevinci Date: Mon, 27 Feb 2023 19:02:16 +0800 Subject: [PATCH] update shader variant collector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 着色器变种收集界面增加单次照射数量的控制。 --- .../ShaderVariantCollectorSetting.cs | 5 +++++ .../ShaderVariantCollectorWindow.cs | 21 ++++++++++++++++++- .../ShaderVariantCollectorWindow.uxml | 8 ++++--- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorSetting.cs b/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorSetting.cs index 320a4c7..658cb1a 100644 --- a/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorSetting.cs +++ b/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorSetting.cs @@ -13,5 +13,10 @@ namespace YooAsset.Editor /// 收集的包裹名称 /// public string CollectPackage = string.Empty; + + /// + /// 容器值 + /// + public int ProcessCapacity = 1000; } } \ No newline at end of file diff --git a/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorWindow.cs b/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorWindow.cs index edc7966..4da2565 100644 --- a/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorWindow.cs +++ b/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorWindow.cs @@ -24,6 +24,7 @@ namespace YooAsset.Editor private TextField _collectOutputField; private Label _currentShaderCountField; private Label _currentVariantCountField; + private SliderInt _processCapacitySlider; private PopupField _packageField; public void CreateGUI() @@ -72,6 +73,23 @@ namespace YooAsset.Editor packageContainer.Add(_packageField); } + // 容器值 + _processCapacitySlider = root.Q("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