Simplify the concept of resource version

简化资源版本概念
This commit is contained in:
hevinci
2022-04-12 19:15:44 +08:00
parent 9fbce6a726
commit ea28d3e6e1
30 changed files with 516 additions and 322 deletions
+31 -6
View File
@@ -82,11 +82,6 @@ namespace YooAsset
/// </summary>
public bool ClearCacheWhenDirty;
/// <summary>
/// 忽略资源版本号
/// </summary>
public bool IgnoreResourceVersion;
/// <summary>
/// 默认的资源服务器下载地址
/// </summary>
@@ -207,7 +202,6 @@ namespace YooAsset
var hostPlayModeParameters = parameters as HostPlayModeParameters;
return _hostPlayModeImpl.InitializeAsync(
hostPlayModeParameters.ClearCacheWhenDirty,
hostPlayModeParameters.IgnoreResourceVersion,
hostPlayModeParameters.DefaultHostServer,
hostPlayModeParameters.FallbackHostServer);
}
@@ -217,6 +211,37 @@ namespace YooAsset
}
}
/// <summary>
/// 向网络端请求静态资源版本号
/// </summary>
/// <param name="timeout">超时时间(默认值:60秒)</param>
/// <returns></returns>
public static UpdateStaticVersionOperation UpdateStaticVersionAsync(int timeout = 60)
{
if (_playMode == EPlayMode.EditorPlayMode)
{
var operation = new EditorModeUpdateStaticVersionOperation();
OperationSystem.ProcessOperaiton(operation);
return operation;
}
else if (_playMode == EPlayMode.OfflinePlayMode)
{
var operation = new OfflinePlayModeUpdateStaticVersionOperation();
OperationSystem.ProcessOperaiton(operation);
return operation;
}
else if (_playMode == EPlayMode.HostPlayMode)
{
if (_hostPlayModeImpl == null)
throw new Exception("YooAsset is not initialized.");
return _hostPlayModeImpl.UpdateStaticVersionAsync(timeout);
}
else
{
throw new NotImplementedException();
}
}
/// <summary>
/// 向网络端请求并更新补丁清单
/// </summary>