예제 #1
0
    private IEnumerator LoadScene()
    {
        AsyncOperation opt = null;

#if UNITY_5_3
        opt = SceneManager.LoadSceneAsync(toLoadSceneData.sceneName);
#else
        opt = Application.LoadLevelAsync(toLoadSceneData.sceneName);
#endif
        yield return(opt);

        if (null != curScene)
        {
            curScene.OnRelease();
        }
        curScene = Activator.CreateInstance(toLoadSceneData.sceneType) as SceneBase;
        curScene.OnLoad();
        if (null != loadComplete)
        {
            loadComplete.Invoke();
        }
    }