setting change
This commit is contained in:
@@ -61,6 +61,7 @@ namespace NBC.Asset
|
||||
{
|
||||
return assetProvider.Asset as T;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -385,6 +386,9 @@ namespace NBC.Asset
|
||||
_monoGameObject = new GameObject("Assets", typeof(Mono));
|
||||
Mono.AddUpdate(Update);
|
||||
InitializationTask task;
|
||||
#if UNITY_STANDALONE_WIN
|
||||
Const.NotCache = true;
|
||||
#endif
|
||||
if (Const.Simulate)
|
||||
{
|
||||
task = new EditorInitializationTask();
|
||||
|
||||
@@ -9,7 +9,8 @@ namespace NBC.Asset
|
||||
public const string VersionFileName = "version.json";
|
||||
|
||||
public static bool IsWebGLPlatform => Application.platform == RuntimePlatform.WebGLPlayer;
|
||||
|
||||
|
||||
|
||||
public static readonly string SavePath =
|
||||
$"{Application.persistentDataPath}{Path.DirectorySeparatorChar}{BundleDirName}{Path.DirectorySeparatorChar}";
|
||||
|
||||
@@ -20,9 +21,10 @@ namespace NBC.Asset
|
||||
|
||||
public static bool Offline;
|
||||
public static bool Simulate;
|
||||
public static bool NotCache;
|
||||
|
||||
public static int DownloadTimeOut = 10;
|
||||
|
||||
|
||||
|
||||
public static string GetStreamingPath(string file)
|
||||
{
|
||||
@@ -31,6 +33,11 @@ namespace NBC.Asset
|
||||
|
||||
public static string GetCachePath(string file)
|
||||
{
|
||||
if (NotCache)
|
||||
{
|
||||
return GetStreamingPath(file);
|
||||
}
|
||||
|
||||
return $"{SavePath}{file}";
|
||||
}
|
||||
|
||||
@@ -45,6 +52,7 @@ namespace NBC.Asset
|
||||
{
|
||||
return $"{RemoteUrl}/{file}";
|
||||
}
|
||||
|
||||
return $"{RemoteUrl}{BundleDirName}/{file}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace NBC.Asset
|
||||
{
|
||||
/// <summary>
|
||||
/// 离线模式初始化任务
|
||||
/// 移动端离线模式初始化任务
|
||||
/// </summary>
|
||||
internal sealed class OfflineInitializationTask : InitializationTask
|
||||
{
|
||||
@@ -10,9 +10,13 @@
|
||||
|
||||
protected override void OnStart()
|
||||
{
|
||||
_taskList.AddTask(new CheckCoverInstallTask());
|
||||
_taskList.AddTask(new UnpackVersionTask());
|
||||
_taskList.AddTask(new CheckUnpackPackageTask());
|
||||
if (!Const.NotCache)
|
||||
{
|
||||
_taskList.AddTask(new CheckCoverInstallTask());
|
||||
_taskList.AddTask(new UnpackVersionTask());
|
||||
_taskList.AddTask(new CheckUnpackPackageTask());
|
||||
}
|
||||
|
||||
_taskList.AddTask(new RunFunctionTask(Addressable.Load));
|
||||
_taskList.Run(TaskRunner.Def);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user