mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-24 09:40:11 +00:00
Update AssetBundleBuilder
This commit is contained in:
@@ -83,8 +83,7 @@ namespace YooAsset.Editor
|
||||
bool isBuildin = IsBuildinBundle(tags, buildinTags);
|
||||
bool isRawFile = bundleInfo.IsRawFile;
|
||||
|
||||
string fileName = GetFileOutputName(outputNameStype, hash, bundleInfo);
|
||||
PatchBundle patchBundle = new PatchBundle(bundleName, fileName, crc32, size, tags);
|
||||
PatchBundle patchBundle = new PatchBundle(bundleName, hash, crc32, size, (byte)outputNameStype, tags);
|
||||
patchBundle.SetFlagsValue(isEncrypted, isBuildin, isRawFile);
|
||||
result.Add(patchBundle);
|
||||
}
|
||||
@@ -104,37 +103,6 @@ namespace YooAsset.Editor
|
||||
}
|
||||
return false;
|
||||
}
|
||||
private string GetFileOutputName(EOutputNameStyle outputNameStyle, string hash, BuildBundleInfo bundleInfo)
|
||||
{
|
||||
string fileName;
|
||||
var bundleName = bundleInfo.BundleName;
|
||||
if (outputNameStyle == EOutputNameStyle.HashName)
|
||||
{
|
||||
fileName = hash;
|
||||
}
|
||||
else if (outputNameStyle == EOutputNameStyle.HashName_Extension)
|
||||
{
|
||||
string tempFileExtension = bundleInfo.GetAppendExtension();
|
||||
fileName = $"{hash}{tempFileExtension}";
|
||||
}
|
||||
else if (outputNameStyle == EOutputNameStyle.BundleName_HashName)
|
||||
{
|
||||
string tempFileExtension = bundleInfo.GetAppendExtension();
|
||||
string tempBundleName = bundleName.Replace('/', '_').Replace(tempFileExtension, "");
|
||||
fileName = $"{tempBundleName}_{hash}";
|
||||
}
|
||||
else if (outputNameStyle == EOutputNameStyle.BundleName_HashName_Extension)
|
||||
{
|
||||
string tempFileExtension = bundleInfo.GetAppendExtension();
|
||||
string tempBundleName = bundleName.Replace('/', '_').Replace(tempFileExtension, "");
|
||||
fileName = $"{tempBundleName}_{hash}{tempFileExtension}";
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
return fileName;
|
||||
}
|
||||
private string GetFileHash(string filePath, bool standardBuild)
|
||||
{
|
||||
if (standardBuild)
|
||||
|
||||
Reference in New Issue
Block a user