通过解密接口判断是否需要走Unpack文件
parent
0232e5adec
commit
f4b7ae21ea
|
@ -51,17 +51,26 @@ namespace YooAsset
|
|||
else if (MainBundleInfo.LoadMode == BundleInfo.ELoadMode.LoadFromStreaming)
|
||||
{
|
||||
#if UNITY_ANDROID
|
||||
EBundleLoadMethod loadMethod = (EBundleLoadMethod)MainBundleInfo.Bundle.LoadMethod;
|
||||
if (loadMethod == EBundleLoadMethod.LoadFromMemory || loadMethod == EBundleLoadMethod.LoadFromStream)
|
||||
{
|
||||
_steps = ESteps.Unpack;
|
||||
FileLoadPath = MainBundleInfo.Bundle.CachedDataFilePath;
|
||||
}
|
||||
else
|
||||
/// 判断是否需要解压文件
|
||||
if( Impl.DecryptionServices != null && Impl.DecryptionServices.UnpackBundleFile == false)
|
||||
{
|
||||
_steps = ESteps.LoadFile;
|
||||
FileLoadPath = MainBundleInfo.Bundle.StreamingFilePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
EBundleLoadMethod loadMethod = (EBundleLoadMethod)MainBundleInfo.Bundle.LoadMethod;
|
||||
if (loadMethod == EBundleLoadMethod.LoadFromMemory || loadMethod == EBundleLoadMethod.LoadFromStream)
|
||||
{
|
||||
_steps = ESteps.Unpack;
|
||||
FileLoadPath = MainBundleInfo.Bundle.CachedDataFilePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.LoadFile;
|
||||
FileLoadPath = MainBundleInfo.Bundle.StreamingFilePath;
|
||||
}
|
||||
}
|
||||
#else
|
||||
_steps = ESteps.LoadFile;
|
||||
FileLoadPath = MainBundleInfo.Bundle.StreamingFilePath;
|
||||
|
|
|
@ -43,8 +43,17 @@ namespace YooAsset
|
|||
else if (MainBundleInfo.LoadMode == BundleInfo.ELoadMode.LoadFromStreaming)
|
||||
{
|
||||
#if UNITY_ANDROID || UNITY_WEBGL
|
||||
_steps = ESteps.Unpack;
|
||||
FileLoadPath = MainBundleInfo.Bundle.CachedDataFilePath;
|
||||
/// 判断是否需要解压文件
|
||||
if (Impl.DecryptionServices != null && Impl.DecryptionServices.UnpackBundleFile == false)
|
||||
{
|
||||
_steps = ESteps.CheckFile;
|
||||
FileLoadPath = MainBundleInfo.Bundle.StreamingFilePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Unpack;
|
||||
FileLoadPath = MainBundleInfo.Bundle.CachedDataFilePath;
|
||||
}
|
||||
#else
|
||||
_steps = ESteps.CheckFile;
|
||||
FileLoadPath = MainBundleInfo.Bundle.StreamingFilePath;
|
||||
|
|
|
@ -19,6 +19,12 @@ namespace YooAsset
|
|||
/// </summary>
|
||||
public interface IDecryptionServices
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 是否需要解压文件
|
||||
/// </summary>
|
||||
bool UnpackBundleFile { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件偏移解密方法
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue