diff --git a/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorSettingData.cs b/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorSettingData.cs index 34a5374..7b097cf 100644 --- a/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorSettingData.cs +++ b/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorSettingData.cs @@ -1,7 +1,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Linq; using UnityEngine; using UnityEditor; @@ -20,6 +19,11 @@ namespace YooAsset.Editor } } + /// + /// 配置数据是否被修改 + /// + public static bool IsDirty { set; get; } = false; + /// /// 加载配置文件 /// @@ -35,6 +39,7 @@ namespace YooAsset.Editor { if (Setting != null) { + IsDirty = false; EditorUtility.SetDirty(Setting); AssetDatabase.SaveAssets(); Debug.Log($"{nameof(ShaderVariantCollectorSetting)}.asset is saved!"); diff --git a/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorWindow.cs b/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorWindow.cs index da6204b..46e9d39 100644 --- a/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorWindow.cs +++ b/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorWindow.cs @@ -20,6 +20,7 @@ namespace YooAsset.Editor private List _packageNames; + private Button _saveButton; private Button _collectButton; private TextField _collectOutputField; private Label _currentShaderCountField; @@ -40,6 +41,10 @@ namespace YooAsset.Editor visualAsset.CloneTree(root); + // 配置保存按钮 + _saveButton = root.Q