update runtime code
1. 新增WebGL专属模式WebPlayMode
This commit is contained in:
@@ -126,6 +126,22 @@ namespace YooAsset
|
||||
initializeParameters.RemoteServices
|
||||
);
|
||||
}
|
||||
else if (_playMode == EPlayMode.WebPlayMode)
|
||||
{
|
||||
var webPlayModeImpl = new WebPlayModeImpl();
|
||||
_bundleServices = webPlayModeImpl;
|
||||
_playModeServices = webPlayModeImpl;
|
||||
_assetSystemImpl.Initialize(PackageName, false,
|
||||
parameters.LoadingMaxTimeSlice, parameters.DownloadFailedTryAgain,
|
||||
parameters.DecryptionServices, _bundleServices);
|
||||
|
||||
var initializeParameters = parameters as WebPlayModeParameters;
|
||||
initializeOperation = webPlayModeImpl.InitializeAsync(
|
||||
PackageName,
|
||||
initializeParameters.QueryServices,
|
||||
initializeParameters.RemoteServices
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -184,9 +200,19 @@ namespace YooAsset
|
||||
_playMode = EPlayMode.OfflinePlayMode;
|
||||
else if (parameters is HostPlayModeParameters)
|
||||
_playMode = EPlayMode.HostPlayMode;
|
||||
else if (parameters is WebPlayModeParameters)
|
||||
_playMode = EPlayMode.WebPlayMode;
|
||||
else
|
||||
throw new NotImplementedException();
|
||||
|
||||
// 检测运行平台
|
||||
if (_playMode == EPlayMode.HostPlayMode || _playMode == EPlayMode.OfflinePlayMode)
|
||||
{
|
||||
#if UNITY_WEBGL
|
||||
throw new Exception($"WebGL plateform not support : {_playMode} ! Please use {nameof(EPlayMode.WebPlayMode)}");
|
||||
#endif
|
||||
}
|
||||
|
||||
// 检测参数范围
|
||||
if (parameters.LoadingMaxTimeSlice < 10)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user