mirror of https://github.com/tuyoogame/YooAsset
parent
28c22694ba
commit
b7a20d4bdb
|
@ -89,10 +89,7 @@ namespace YooAsset.Editor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string GetAppendExtension()
|
public string GetAppendExtension()
|
||||||
{
|
{
|
||||||
if (IsRawFile)
|
return System.IO.Path.GetExtension(BundleName);
|
||||||
return $".{YooAssetSettingsData.Setting.RawFileVariant}";
|
|
||||||
else
|
|
||||||
return $".{YooAssetSettingsData.Setting.AssetBundleFileVariant}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -94,7 +94,7 @@ namespace YooAsset.Editor
|
||||||
if (buildAssetInfo.BundleNameIsValid() == false)
|
if (buildAssetInfo.BundleNameIsValid() == false)
|
||||||
{
|
{
|
||||||
string bundleName = defaultPackRule.GetBundleName(new PackRuleData(buildAssetInfo.AssetPath));
|
string bundleName = defaultPackRule.GetBundleName(new PackRuleData(buildAssetInfo.AssetPath));
|
||||||
bundleName = AssetBundleCollector.RevisedBundleName(bundleName);
|
bundleName = AssetBundleCollector.RevisedBundleName(bundleName, false);
|
||||||
buildAssetInfo.SetBundleName(bundleName);
|
buildAssetInfo.SetBundleName(bundleName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ namespace YooAsset.Editor
|
||||||
continue;
|
continue;
|
||||||
if (result.ContainsKey(assetPath) == false)
|
if (result.ContainsKey(assetPath) == false)
|
||||||
{
|
{
|
||||||
string bundleName = GetBundleName(grouper, assetPath);
|
string bundleName = GetBundleName(grouper, assetPath, isRawAsset);
|
||||||
List<string> assetTags = GetAssetTags(grouper);
|
List<string> assetTags = GetAssetTags(grouper);
|
||||||
var collectAssetInfo = new CollectAssetInfo(bundleName, assetPath, assetTags, isRawAsset, NotWriteToAssetList);
|
var collectAssetInfo = new CollectAssetInfo(bundleName, assetPath, assetTags, isRawAsset, NotWriteToAssetList);
|
||||||
collectAssetInfo.DependAssets = GetAllDependencies(assetPath);
|
collectAssetInfo.DependAssets = GetAllDependencies(assetPath);
|
||||||
|
@ -91,7 +91,7 @@ namespace YooAsset.Editor
|
||||||
if (isRawAsset && NotWriteToAssetList)
|
if (isRawAsset && NotWriteToAssetList)
|
||||||
UnityEngine.Debug.LogWarning($"Are you sure raw file are not write to asset list : {assetPath}");
|
UnityEngine.Debug.LogWarning($"Are you sure raw file are not write to asset list : {assetPath}");
|
||||||
|
|
||||||
string bundleName = GetBundleName(grouper, assetPath);
|
string bundleName = GetBundleName(grouper, assetPath, isRawAsset);
|
||||||
List<string> assetTags = GetAssetTags(grouper);
|
List<string> assetTags = GetAssetTags(grouper);
|
||||||
var collectAssetInfo = new CollectAssetInfo(bundleName, assetPath, assetTags, isRawAsset, NotWriteToAssetList);
|
var collectAssetInfo = new CollectAssetInfo(bundleName, assetPath, assetTags, isRawAsset, NotWriteToAssetList);
|
||||||
result.Add(assetPath, collectAssetInfo);
|
result.Add(assetPath, collectAssetInfo);
|
||||||
|
@ -139,7 +139,7 @@ namespace YooAsset.Editor
|
||||||
IFilterRule filterRuleInstance = AssetBundleGrouperSettingData.GetFilterRuleInstance(FilterRuleName);
|
IFilterRule filterRuleInstance = AssetBundleGrouperSettingData.GetFilterRuleInstance(FilterRuleName);
|
||||||
return filterRuleInstance.IsCollectAsset(new FilterRuleData(assetPath));
|
return filterRuleInstance.IsCollectAsset(new FilterRuleData(assetPath));
|
||||||
}
|
}
|
||||||
private string GetBundleName(AssetBundleGrouper grouper, string assetPath)
|
private string GetBundleName(AssetBundleGrouper grouper, string assetPath, bool isRawAsset)
|
||||||
{
|
{
|
||||||
// 如果收集全路径着色器
|
// 如果收集全路径着色器
|
||||||
if (AssetBundleGrouperSettingData.Setting.AutoCollectShaders)
|
if (AssetBundleGrouperSettingData.Setting.AutoCollectShaders)
|
||||||
|
@ -147,14 +147,17 @@ namespace YooAsset.Editor
|
||||||
System.Type assetType = AssetDatabase.GetMainAssetTypeAtPath(assetPath);
|
System.Type assetType = AssetDatabase.GetMainAssetTypeAtPath(assetPath);
|
||||||
if (assetType == typeof(UnityEngine.Shader))
|
if (assetType == typeof(UnityEngine.Shader))
|
||||||
{
|
{
|
||||||
return RevisedBundleName(AssetBundleGrouperSettingData.Setting.ShadersBundleName);
|
string bundleName = AssetBundleGrouperSettingData.Setting.ShadersBundleName;
|
||||||
|
return RevisedBundleName(bundleName, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据规则设置获取资源包名称
|
// 根据规则设置获取资源包名称
|
||||||
|
{
|
||||||
IPackRule packRuleInstance = AssetBundleGrouperSettingData.GetPackRuleInstance(PackRuleName);
|
IPackRule packRuleInstance = AssetBundleGrouperSettingData.GetPackRuleInstance(PackRuleName);
|
||||||
string bundleName = packRuleInstance.GetBundleName(new PackRuleData(assetPath, CollectPath, grouper.GrouperName));
|
string bundleName = packRuleInstance.GetBundleName(new PackRuleData(assetPath, CollectPath, grouper.GrouperName));
|
||||||
return RevisedBundleName(bundleName);
|
return RevisedBundleName(bundleName, isRawAsset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private List<string> GetAssetTags(AssetBundleGrouper grouper)
|
private List<string> GetAssetTags(AssetBundleGrouper grouper)
|
||||||
{
|
{
|
||||||
|
@ -183,9 +186,18 @@ namespace YooAsset.Editor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 修正资源包名
|
/// 修正资源包名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string RevisedBundleName(string bundleName)
|
public static string RevisedBundleName(string bundleName, bool isRawBundle)
|
||||||
{
|
{
|
||||||
return EditorTools.GetRegularPath(bundleName).ToLower();
|
if (isRawBundle)
|
||||||
|
{
|
||||||
|
string fullName = $"{bundleName}.{YooAssetSettingsData.Setting.RawFileVariant}";
|
||||||
|
return EditorTools.GetRegularPath(fullName).ToLower();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string fullName = $"{bundleName}.{YooAssetSettingsData.Setting.AssetBundleFileVariant}";
|
||||||
|
return EditorTools.GetRegularPath(fullName).ToLower(); ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue