Optimize collector window jank problem

优化了资源收集窗体卡顿问题。
pull/9/head
hevinci 2022-05-04 19:47:01 +08:00
parent 0c116b7701
commit d592fb96a6
1 changed files with 27 additions and 6 deletions

View File

@ -402,7 +402,13 @@ namespace YooAsset.Editor
// Foldout // Foldout
var foldout = element.Q<Foldout>("Foldout1"); var foldout = element.Q<Foldout>("Foldout1");
RefreshFoldout(foldout, selectGrouper, collector); foldout.RegisterValueChangedCallback(evt =>
{
if (evt.newValue)
RefreshFoldout(foldout, selectGrouper, collector);
else
foldout.Clear();
});
// Remove Button // Remove Button
var removeBtn = element.Q<Button>("Button1"); var removeBtn = element.Q<Button>("Button1");
@ -419,7 +425,10 @@ namespace YooAsset.Editor
collector.CollectPath = AssetDatabase.GetAssetPath(evt.newValue); collector.CollectPath = AssetDatabase.GetAssetPath(evt.newValue);
objectField1.value.name = collector.CollectPath; objectField1.value.name = collector.CollectPath;
AssetBundleGrouperSettingData.ModifyCollector(selectGrouper, collector); AssetBundleGrouperSettingData.ModifyCollector(selectGrouper, collector);
RefreshFoldout(foldout, selectGrouper, collector); if (foldout.value)
{
RefreshFoldout(foldout, selectGrouper, collector);
}
}); });
// Collector Type // Collector Type
@ -429,7 +438,10 @@ namespace YooAsset.Editor
{ {
collector.CollectorType = StringUtility.NameToEnum<ECollectorType>(evt.newValue); collector.CollectorType = StringUtility.NameToEnum<ECollectorType>(evt.newValue);
AssetBundleGrouperSettingData.ModifyCollector(selectGrouper, collector); AssetBundleGrouperSettingData.ModifyCollector(selectGrouper, collector);
RefreshFoldout(foldout, selectGrouper, collector); if (foldout.value)
{
RefreshFoldout(foldout, selectGrouper, collector);
}
}); });
// Address Rule // Address Rule
@ -441,7 +453,10 @@ namespace YooAsset.Editor
{ {
collector.AddressRuleName = evt.newValue; collector.AddressRuleName = evt.newValue;
AssetBundleGrouperSettingData.ModifyCollector(selectGrouper, collector); AssetBundleGrouperSettingData.ModifyCollector(selectGrouper, collector);
RefreshFoldout(foldout, selectGrouper, collector); if (foldout.value)
{
RefreshFoldout(foldout, selectGrouper, collector);
}
}); });
} }
@ -452,7 +467,10 @@ namespace YooAsset.Editor
{ {
collector.PackRuleName = evt.newValue; collector.PackRuleName = evt.newValue;
AssetBundleGrouperSettingData.ModifyCollector(selectGrouper, collector); AssetBundleGrouperSettingData.ModifyCollector(selectGrouper, collector);
RefreshFoldout(foldout, selectGrouper, collector); if (foldout.value)
{
RefreshFoldout(foldout, selectGrouper, collector);
}
}); });
// Filter Rule // Filter Rule
@ -462,7 +480,10 @@ namespace YooAsset.Editor
{ {
collector.FilterRuleName = evt.newValue; collector.FilterRuleName = evt.newValue;
AssetBundleGrouperSettingData.ModifyCollector(selectGrouper, collector); AssetBundleGrouperSettingData.ModifyCollector(selectGrouper, collector);
RefreshFoldout(foldout, selectGrouper, collector); if (foldout.value)
{
RefreshFoldout(foldout, selectGrouper, collector);
}
}); });
// Tags // Tags