mirror of https://github.com/tuyoogame/YooAsset
update editor logic
parent
a1d5949177
commit
3a81d7babd
|
@ -297,8 +297,8 @@ namespace YooAsset.Editor
|
|||
}
|
||||
private List<string> GetAssetTags(AssetBundleCollectorGroup group)
|
||||
{
|
||||
List<string> tags = StringUtility.StringToStringList(group.AssetTags, ';');
|
||||
List<string> temper = StringUtility.StringToStringList(AssetTags, ';');
|
||||
List<string> tags = EditorTools.StringToStringList(group.AssetTags, ';');
|
||||
List<string> temper = EditorTools.StringToStringList(AssetTags, ';');
|
||||
tags.AddRange(temper);
|
||||
return tags;
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ namespace YooAsset.Editor
|
|||
AssetBundleCollector collector = new AssetBundleCollector();
|
||||
collector.CollectPath = collectorElement.GetAttribute(XmlCollectPath);
|
||||
collector.CollectorGUID = collectorElement.GetAttribute(XmlCollectorGUID);
|
||||
collector.CollectorType = StringUtility.NameToEnum<ECollectorType>(collectorElement.GetAttribute(XmlCollectorType));
|
||||
collector.CollectorType = EditorTools.NameToEnum<ECollectorType>(collectorElement.GetAttribute(XmlCollectorType));
|
||||
collector.AddressRuleName = collectorElement.GetAttribute(XmlAddressRule);
|
||||
collector.PackRuleName = collectorElement.GetAttribute(XmlPackRule);
|
||||
collector.FilterRuleName = collectorElement.GetAttribute(XmlFilterRule);
|
||||
|
|
|
@ -102,7 +102,7 @@ namespace YooAsset.Editor
|
|||
HashSet<string> result = new HashSet<string>();
|
||||
foreach (var group in Groups)
|
||||
{
|
||||
List<string> groupTags = StringUtility.StringToStringList(group.AssetTags, ';');
|
||||
List<string> groupTags = EditorTools.StringToStringList(group.AssetTags, ';');
|
||||
foreach (var tag in groupTags)
|
||||
{
|
||||
if (result.Contains(tag) == false)
|
||||
|
@ -111,7 +111,7 @@ namespace YooAsset.Editor
|
|||
|
||||
foreach (var collector in group.Collectors)
|
||||
{
|
||||
List<string> collectorTags = StringUtility.StringToStringList(collector.AssetTags, ';');
|
||||
List<string> collectorTags = EditorTools.StringToStringList(collector.AssetTags, ';');
|
||||
foreach (var tag in collectorTags)
|
||||
{
|
||||
if (result.Contains(tag) == false)
|
||||
|
|
|
@ -694,7 +694,7 @@ namespace YooAsset.Editor
|
|||
popupField0.index = GetCollectorTypeIndex(collector.CollectorType.ToString());
|
||||
popupField0.RegisterValueChangedCallback(evt =>
|
||||
{
|
||||
collector.CollectorType = StringUtility.NameToEnum<ECollectorType>(evt.newValue);
|
||||
collector.CollectorType = EditorTools.NameToEnum<ECollectorType>(evt.newValue);
|
||||
AssetBundleCollectorSettingData.ModifyCollector(selectGroup, collector);
|
||||
if (foldout.value)
|
||||
{
|
||||
|
|
|
@ -285,6 +285,35 @@ namespace YooAsset.Editor
|
|||
}
|
||||
#endregion
|
||||
|
||||
#region StringUtility
|
||||
public static List<string> StringToStringList(string str, char separator)
|
||||
{
|
||||
List<string> result = new List<string>();
|
||||
if (!String.IsNullOrEmpty(str))
|
||||
{
|
||||
string[] splits = str.Split(separator);
|
||||
foreach (string split in splits)
|
||||
{
|
||||
string value = split.Trim(); //移除首尾空格
|
||||
if (!String.IsNullOrEmpty(value))
|
||||
{
|
||||
result.Add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static T NameToEnum<T>(string name)
|
||||
{
|
||||
if (Enum.IsDefined(typeof(T), name) == false)
|
||||
{
|
||||
throw new ArgumentException($"Enum {typeof(T)} is not defined name {name}");
|
||||
}
|
||||
return (T)Enum.Parse(typeof(T), name);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 文件
|
||||
/// <summary>
|
||||
/// 创建文件所在的目录
|
||||
|
|
Loading…
Reference in New Issue