Exemplo n.º 1
0
    // 异步加载
    IEnumerator LoadAsysnScene(string sceneName)
    {
        // 显示Loading界面
        loadingWin.Show();

        while (loadingWin.isShow)
        {
            yield return(null);
        }

        // 开始加载新场景
        AsyncOperation async = Application.LoadLevelAsync(sceneName);

        while (!async.isDone)
        {
            yield return(async);
        }

        yield return(new WaitForSeconds(2f));

        // 隐藏Loading界面
        loadingWin.Hide();
    }