使用异步加载的方式加载场景。
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneLoadModel
{
private AsyncOperation asyncOperation;
/// <summary>
/// 场景加载异步操作对象
/// </summary>
public AsyncOperation AsyncOperation
{
get
{
return asyncOperation;
}
set
{
asyncOperation = value;
}
}
}
public class SceneLoadManager
{
#region Singleton
private static SceneLoadManager instance;
private SceneLoadManager()
{
sceneLoadModel = new SceneLoadModel();
}
public static SceneLoadManager Instance
{
get
{
if (instance == null)
{
instance = new SceneLoadManager();
}
return instance;
}
}
#endregion
private SceneLoadModel sceneLoadModel;
/// <summary>
/// 加载主界面
/// <