mirror of https://github.com/tuyoogame/YooAsset
feat : add load scene sync method
parent
42104eb944
commit
f4ddaedbf4
|
@ -64,6 +64,7 @@ namespace YooAsset
|
|||
{
|
||||
LoadSceneParameters parameters = new LoadSceneParameters(SceneMode);
|
||||
SceneObject = SceneManager.LoadScene(MainAssetInfo.AssetPath, parameters);
|
||||
_steps = ESteps.Checking;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -61,6 +61,7 @@ namespace YooAsset
|
|||
{
|
||||
LoadSceneParameters loadSceneParameters = new LoadSceneParameters(SceneMode);
|
||||
SceneObject = UnityEditor.SceneManagement.EditorSceneManager.LoadSceneInPlayMode(MainAssetInfo.AssetPath, loadSceneParameters);
|
||||
_steps = ESteps.Checking;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -156,6 +156,28 @@ namespace YooAsset
|
|||
#endregion
|
||||
|
||||
#region 场景加载
|
||||
/// <summary>
|
||||
/// 同步加载场景
|
||||
/// </summary>
|
||||
/// <param name="location">场景的定位地址</param>
|
||||
/// <param name="sceneMode">场景加载模式</param>
|
||||
public static SceneHandle LoadSceneSync(string location, LoadSceneMode sceneMode = LoadSceneMode.Single)
|
||||
{
|
||||
DebugCheckDefaultPackageValid();
|
||||
return _defaultPackage.LoadSceneSync(location, sceneMode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 同步加载场景
|
||||
/// </summary>
|
||||
/// <param name="assetInfo">场景的资源信息</param>
|
||||
/// <param name="sceneMode">场景加载模式</param>
|
||||
public static SceneHandle LoadSceneSync(AssetInfo assetInfo, LoadSceneMode sceneMode = LoadSceneMode.Single)
|
||||
{
|
||||
DebugCheckDefaultPackageValid();
|
||||
return _defaultPackage.LoadSceneSync(assetInfo, sceneMode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步加载场景
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue