mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
update:统一WebGL平台与其他平台的远程热更资源引用方式
This commit is contained in:
@@ -10,18 +10,6 @@ namespace TEngine
|
|||||||
public const string RootFolderName = "yoo";
|
public const string RootFolderName = "yoo";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 内置文件查询服务类。
|
|
||||||
/// </summary>
|
|
||||||
public class BuiltinQueryServices : IBuildinQueryServices
|
|
||||||
{
|
|
||||||
public bool QueryStreamingAssets(string packageName, string fileName)
|
|
||||||
{
|
|
||||||
// 注意:fileName包含文件格式
|
|
||||||
return BuiltinQueryMgr.FileExists(packageName, fileName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 内置资源资源查询帮助类。
|
/// 内置资源资源查询帮助类。
|
||||||
|
@@ -84,6 +84,29 @@ namespace TEngine
|
|||||||
return $"{_defaultHostServer}/{_packageName}/{fileName}";
|
return $"{_defaultHostServer}/{_packageName}/{fileName}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 内置文件查询服务类。
|
||||||
|
/// </summary>
|
||||||
|
public class BuiltinQueryServices : IBuildinQueryServices
|
||||||
|
{
|
||||||
|
public bool QueryStreamingAssets(string packageName, string fileName)
|
||||||
|
{
|
||||||
|
// 注意:fileName包含文件格式
|
||||||
|
return BuiltinQueryMgr.FileExists(packageName, fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// WebGL内置文件查询服务类。WebGL平台不需要内置查询,直接使用远程热更资源。
|
||||||
|
/// </summary>
|
||||||
|
public class WebGLBuiltinQueryServices : IBuildinQueryServices
|
||||||
|
{
|
||||||
|
public bool QueryStreamingAssets(string packageName, string fileName)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BundleStream : FileStream
|
public class BundleStream : FileStream
|
||||||
|
@@ -394,8 +394,11 @@ namespace TEngine
|
|||||||
YooAssets.SetCacheSystemDisableCacheOnWebGL();
|
YooAssets.SetCacheSystemDisableCacheOnWebGL();
|
||||||
var createParameters = new WebPlayModeParameters();
|
var createParameters = new WebPlayModeParameters();
|
||||||
createParameters.DecryptionServices = new GameDecryptionServices();
|
createParameters.DecryptionServices = new GameDecryptionServices();
|
||||||
createParameters.BuildinQueryServices = new BuiltinQueryServices();
|
createParameters.BuildinQueryServices = new WebGLBuiltinQueryServices();
|
||||||
createParameters.RemoteServices = new RemoteServices(targetPackageName);
|
createParameters.RemoteServices = new RemoteServices(targetPackageName);
|
||||||
|
// WebGL运行模式下,直接使用远程热更资源。
|
||||||
|
createParameters.BuildinRootDirectory = SettingsUtils.FrameworkGlobalSettings.HostServerURL;
|
||||||
|
createParameters.SandboxRootDirectory = SettingsUtils.FrameworkGlobalSettings.HostServerURL;
|
||||||
initializationOperation = package.InitializeAsync(createParameters);
|
initializationOperation = package.InitializeAsync(createParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user