mirror of https://github.com/tuyoogame/YooAsset
update runtime code
parent
66cd491493
commit
de09a042e6
|
@ -2,7 +2,6 @@
|
|||
using System.IO;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
|
@ -270,24 +269,26 @@ namespace YooAsset
|
|||
/// <summary>
|
||||
/// 生成Bundle文件的正式名称
|
||||
/// </summary>
|
||||
public static string CreateBundleFileName(int nameStype, string bundleName, string fileHash, bool isRawFile)
|
||||
public static string CreateBundleFileName(int nameStyle, string bundleName, string fileHash, bool isRawFile)
|
||||
{
|
||||
if (nameStype == 1)
|
||||
{
|
||||
return fileHash;
|
||||
}
|
||||
else if (nameStype == 2)
|
||||
if (nameStyle == 1) //HashName
|
||||
{
|
||||
string fileExtension = isRawFile ? YooAssetSettingsData.Setting.RawFileVariant : YooAssetSettingsData.Setting.AssetBundleFileVariant;
|
||||
return StringUtility.Format("{0}.{1}", fileHash, fileExtension);
|
||||
}
|
||||
else if (nameStype == 4)
|
||||
else if (nameStyle == 2) //BundleName
|
||||
{
|
||||
return StringUtility.Format("{0}_{1}", fileHash, bundleName);
|
||||
return bundleName;
|
||||
}
|
||||
else if (nameStyle == 4) //BundleName_HashName
|
||||
{
|
||||
string fileName = bundleName.Remove(bundleName.LastIndexOf('.'));
|
||||
string fileExtension = isRawFile ? YooAssetSettingsData.Setting.RawFileVariant : YooAssetSettingsData.Setting.AssetBundleFileVariant;
|
||||
return StringUtility.Format("{0}_{1}.{2}", fileName, fileHash, fileExtension);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotImplementedException($"Invalid nameStype {nameStype}");
|
||||
throw new NotImplementedException($"Invalid name style : {nameStyle}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,11 @@ namespace YooAsset
|
|||
/// </summary>
|
||||
public string PatchManifestFileName = "PatchManifest";
|
||||
|
||||
/// <summary>
|
||||
/// 资源包名正规化(移除路径分隔符)
|
||||
/// </summary>
|
||||
public bool RegularBundleName = true;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 清单文件头标记
|
||||
|
@ -34,7 +39,7 @@ namespace YooAsset
|
|||
/// <summary>
|
||||
/// 清单文件格式版本
|
||||
/// </summary>
|
||||
public const string PatchManifestFileVersion = "1.3.4";
|
||||
public const string PatchManifestFileVersion = "1.4.0";
|
||||
|
||||
/// <summary>
|
||||
/// 构建输出文件夹名称
|
||||
|
|
Loading…
Reference in New Issue