mirror of https://github.com/tuyoogame/YooAsset
parent
045e74c82f
commit
1dc434832a
|
@ -70,11 +70,13 @@ namespace YooAsset
|
||||||
// 2. 加载场景
|
// 2. 加载场景
|
||||||
if (Status == EStatus.Loading)
|
if (Status == EStatus.Loading)
|
||||||
{
|
{
|
||||||
_asyncOp = SceneManager.LoadSceneAsync(_sceneName, SceneMode);
|
// 注意:如果场景不存在则返回NULL
|
||||||
|
_asyncOp = SceneManager.LoadSceneAsync(MainAssetInfo.AssetPath, SceneMode);
|
||||||
if (_asyncOp != null)
|
if (_asyncOp != null)
|
||||||
{
|
{
|
||||||
_asyncOp.allowSceneActivation = true;
|
_asyncOp.allowSceneActivation = true;
|
||||||
_asyncOp.priority = _priority;
|
_asyncOp.priority = _priority;
|
||||||
|
SceneObject = SceneManager.GetSceneAt(SceneManager.sceneCount - 1);
|
||||||
Status = EStatus.Checking;
|
Status = EStatus.Checking;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -91,7 +93,6 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
if (_asyncOp.isDone)
|
if (_asyncOp.isDone)
|
||||||
{
|
{
|
||||||
SceneObject = SceneManager.GetSceneByName(_sceneName);
|
|
||||||
if (SceneObject.IsValid() && _activateOnLoad)
|
if (SceneObject.IsValid() && _activateOnLoad)
|
||||||
SceneManager.SetActiveScene(SceneObject);
|
SceneManager.SetActiveScene(SceneObject);
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
_asyncOp.allowSceneActivation = true;
|
_asyncOp.allowSceneActivation = true;
|
||||||
_asyncOp.priority = _priority;
|
_asyncOp.priority = _priority;
|
||||||
|
SceneObject = SceneManager.GetSceneAt(SceneManager.sceneCount - 1);
|
||||||
Status = EStatus.Checking;
|
Status = EStatus.Checking;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -61,8 +62,7 @@ namespace YooAsset
|
||||||
if (Status == EStatus.Checking)
|
if (Status == EStatus.Checking)
|
||||||
{
|
{
|
||||||
if (_asyncOp.isDone)
|
if (_asyncOp.isDone)
|
||||||
{
|
{
|
||||||
SceneObject = SceneManager.GetSceneAt(SceneManager.sceneCount - 1);
|
|
||||||
if (SceneObject.IsValid() && _activateOnLoad)
|
if (SceneObject.IsValid() && _activateOnLoad)
|
||||||
SceneManager.SetActiveScene(SceneObject);
|
SceneManager.SetActiveScene(SceneObject);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue