Update patch manifest
This commit is contained in:
@@ -26,6 +26,11 @@ namespace YooAsset
|
||||
/// </summary>
|
||||
public long SizeBytes;
|
||||
|
||||
/// <summary>
|
||||
/// 名字样式
|
||||
/// </summary>
|
||||
public byte NameStyle;
|
||||
|
||||
/// <summary>
|
||||
/// 资源包的分类标签
|
||||
/// </summary>
|
||||
@@ -52,14 +57,55 @@ namespace YooAsset
|
||||
/// </summary>
|
||||
public bool IsRawFile { private set; get; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件名称
|
||||
/// </summary>
|
||||
public string FileName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_fileName != null)
|
||||
return _fileName;
|
||||
|
||||
if (NameStyle == 1)
|
||||
{
|
||||
_fileName = Hash;
|
||||
}
|
||||
else if (NameStyle == 2)
|
||||
{
|
||||
string tempFileExtension = System.IO.Path.GetExtension(BundleName);
|
||||
_fileName = $"{Hash}{tempFileExtension}";
|
||||
}
|
||||
else if (NameStyle == 3)
|
||||
{
|
||||
string tempFileExtension = System.IO.Path.GetExtension(BundleName);
|
||||
string tempBundleName = BundleName.Replace('/', '_').Replace(tempFileExtension, "");
|
||||
_fileName = $"{tempBundleName}_{Hash}";
|
||||
}
|
||||
else if (NameStyle == 4)
|
||||
{
|
||||
string tempFileExtension = System.IO.Path.GetExtension(BundleName);
|
||||
string tempBundleName = BundleName.Replace('/', '_').Replace(tempFileExtension, "");
|
||||
_fileName = $"{tempBundleName}_{Hash}{tempFileExtension}";
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
return _fileName;
|
||||
}
|
||||
}
|
||||
private string _fileName = null;
|
||||
|
||||
|
||||
public PatchBundle(string bundleName, string hash, string crc, long sizeBytes, string[] tags)
|
||||
public PatchBundle(string bundleName, string hash, string crc, long sizeBytes, byte nameStyle, string[] tags)
|
||||
{
|
||||
BundleName = bundleName;
|
||||
Hash = hash;
|
||||
CRC = crc;
|
||||
SizeBytes = sizeBytes;
|
||||
NameStyle = nameStyle;
|
||||
Tags = tags;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user