mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Update YooAsset 2.3.8 -> 2.3.12
This commit is contained in:
@@ -36,6 +36,16 @@ namespace YooAsset
|
||||
_index = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取有效数据
|
||||
/// </summary>
|
||||
public byte[] GetBytes()
|
||||
{
|
||||
byte[] newArray = new byte[_index];
|
||||
Buffer.BlockCopy(_buffer, 0, newArray, 0, _index);
|
||||
return newArray;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将有效数据写入文件流
|
||||
/// </summary>
|
||||
|
@@ -34,6 +34,20 @@ namespace YooAsset
|
||||
return str.Remove(index); //"assets/config/test.unity3d" --> "assets/config/test"
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// URL地址是否包含双斜杠
|
||||
/// 注意:只检查协议之后的部分
|
||||
/// </summary>
|
||||
public static bool HasDoubleSlashes(string url)
|
||||
{
|
||||
if (url == null)
|
||||
throw new ArgumentNullException();
|
||||
|
||||
int protocolIndex = url.IndexOf("://");
|
||||
string partToCheck = protocolIndex == -1 ? url : url.Substring(protocolIndex + 3);
|
||||
return partToCheck.Contains("//") || partToCheck.Contains(@"\\");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 合并路径
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user