update asset bundle collector

收集界面增加用户自定义数据栏。
This commit is contained in:
hevinci
2023-02-22 18:41:12 +08:00
parent 5a98a68c27
commit 157402bb39
8 changed files with 65 additions and 109 deletions

View File

@@ -582,18 +582,6 @@ namespace YooAsset.Editor
label.style.width = 90;
elementBottom.Add(label);
}
{
var textField = new TextField();
textField.name = "TextField0";
textField.label = "Address";
textField.style.unityTextAlign = TextAnchor.MiddleLeft;
textField.style.flexGrow = 1f;
elementBottom.Add(textField);
var label = textField.Q<Label>();
textField.style.width = 200;
label.style.minWidth = 63;
}
{
var popupField = new PopupField<string>(_collectorTypeList, 0);
popupField.name = "PopupField0";
@@ -606,14 +594,14 @@ namespace YooAsset.Editor
var popupField = new PopupField<RuleDisplayName>(_addressRuleList, 0);
popupField.name = "PopupField1";
popupField.style.unityTextAlign = TextAnchor.MiddleLeft;
popupField.style.width = 200;
popupField.style.width = 220;
elementBottom.Add(popupField);
}
{
var popupField = new PopupField<RuleDisplayName>(_packRuleList, 0);
popupField.name = "PopupField2";
popupField.style.unityTextAlign = TextAnchor.MiddleLeft;
popupField.style.width = 230;
popupField.style.width = 220;
elementBottom.Add(popupField);
}
{
@@ -624,12 +612,13 @@ namespace YooAsset.Editor
elementBottom.Add(popupField);
}
{
var IsMultiPlatform = new Toggle();
IsMultiPlatform.name = "IsMultiPlatform";
IsMultiPlatform.text = "MultiPlatform";
IsMultiPlatform.style.unityTextAlign = TextAnchor.MiddleCenter;
IsMultiPlatform.style.flexGrow = 0f;
elementTop.Add(IsMultiPlatform);
var textField = new TextField();
textField.name = "TextField0";
textField.label = "UserData";
textField.style.width = 200;
elementBottom.Add(textField);
var label = textField.Q<Label>();
label.style.minWidth = 63;
}
{
var textField = new TextField();
@@ -694,15 +683,6 @@ namespace YooAsset.Editor
RemoveCollectorBtn_clicked(collector);
};
// Address
var textFiled0 = element.Q<TextField>("TextField0");
textFiled0.SetValueWithoutNotify(collector.Address);
textFiled0.RegisterValueChangedCallback(evt =>
{
collector.Address = evt.newValue;
AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector);
});
// Collector Path
var objectField1 = element.Q<ObjectField>("ObjectField1");
objectField1.SetValueWithoutNotify(collectObject);
@@ -779,12 +759,12 @@ namespace YooAsset.Editor
}
});
// MultiPlatform
var IsMultiPlatform = element.Q<Toggle>("IsMultiPlatform");
IsMultiPlatform.SetValueWithoutNotify(collector.IsMultiPlatform);
IsMultiPlatform.RegisterValueChangedCallback(evt =>
// UserData
var textFiled0 = element.Q<TextField>("TextField0");
textFiled0.SetValueWithoutNotify(collector.UserData);
textFiled0.RegisterValueChangedCallback(evt =>
{
collector.IsMultiPlatform = evt.newValue;
collector.UserData = evt.newValue;
AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector);
});
@@ -834,7 +814,7 @@ namespace YooAsset.Editor
if (_enableAddressableToogle.value)
{
IAddressRule instance = AssetBundleCollectorSettingData.GetAddressRuleInstance(collector.AddressRuleName);
AddressRuleData ruleData = new AddressRuleData(collectAssetInfo.AssetPath, collector.CollectPath, group.GroupName, collector.Address, collector.IsMultiPlatform);
AddressRuleData ruleData = new AddressRuleData(collectAssetInfo.AssetPath, collector.CollectPath, group.GroupName, collector.UserData);
string addressValue = instance.GetAssetAddress(ruleData);
showInfo = $"[{addressValue}] {showInfo}";
}