Merge branch 'tuyoogame:main' into main

pull/13/head
susices 2022-06-18 18:27:28 +08:00 committed by GitHub
commit 14127e8097
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 10 deletions

View File

@ -9,9 +9,9 @@ namespace YooAsset.Editor
{ {
private string _mainBundleName; private string _mainBundleName;
private string _shareBundleName; private string _shareBundleName;
private readonly HashSet<string> _referenceBundleNames = new HashSet<string>();
private bool _isAddAssetTags = false; private bool _isAddAssetTags = false;
private readonly HashSet<string> _referenceBundleNames = new HashSet<string>();
/// <summary> /// <summary>
/// 收集器类型 /// 收集器类型
/// </summary> /// </summary>
@ -68,9 +68,9 @@ namespace YooAsset.Editor
else else
IsShaderAsset = false; IsShaderAsset = false;
} }
public BuildAssetInfo(ECollectorType collectorType, string assetPath) public BuildAssetInfo(string assetPath)
{ {
CollectorType = collectorType; CollectorType = ECollectorType.None;
Address = string.Empty; Address = string.Empty;
AssetPath = assetPath; AssetPath = assetPath;
IsRawAsset = false; IsRawAsset = false;
@ -185,11 +185,9 @@ namespace YooAsset.Editor
if (_referenceBundleNames.Count > 1) if (_referenceBundleNames.Count > 1)
{ {
var bundleNameList = _referenceBundleNames.ToList(); IPackRule packRule = PackDirectory.StaticPackRule;
bundleNameList.Sort(); var bundleName = packRule.GetBundleName(new PackRuleData(AssetPath));
string combineName = string.Join("|", bundleNameList); var shareBundleName = $"share_{bundleName}.{YooAssetSettingsData.Setting.AssetBundleFileVariant}";
var combineNameHash = HashUtility.StringSHA1(combineName);
var shareBundleName = $"share_{combineNameHash}.{YooAssetSettingsData.Setting.AssetBundleFileVariant}";
_shareBundleName = EditorTools.GetRegularPath(shareBundleName).ToLower(); _shareBundleName = EditorTools.GetRegularPath(shareBundleName).ToLower();
} }
} }

View File

@ -65,7 +65,7 @@ namespace YooAsset.Editor
} }
else else
{ {
var buildAssetInfo = new BuildAssetInfo(ECollectorType.None, dependAssetPath); var buildAssetInfo = new BuildAssetInfo(dependAssetPath);
buildAssetInfo.AddBundleTags(collectAssetInfo.AssetTags); buildAssetInfo.AddBundleTags(collectAssetInfo.AssetTags);
buildAssetInfo.AddReferenceBundleName(collectAssetInfo.BundleName); buildAssetInfo.AddReferenceBundleName(collectAssetInfo.BundleName);
buildAssetDic.Add(dependAssetPath, buildAssetInfo); buildAssetDic.Add(dependAssetPath, buildAssetInfo);

View File

@ -28,6 +28,8 @@ namespace YooAsset.Editor
/// </summary> /// </summary>
public class PackDirectory : IPackRule public class PackDirectory : IPackRule
{ {
public static PackDirectory StaticPackRule = new PackDirectory();
string IPackRule.GetBundleName(PackRuleData data) string IPackRule.GetBundleName(PackRuleData data)
{ {
return Path.GetDirectoryName(data.AssetPath); return Path.GetDirectoryName(data.AssetPath);