IEnumerator LoadWarSupportPlayerViewScene_Impl(System.Action <SceneResInfoManager> callBack)
    {
        if (AssetBundleManager.isCanLoadLevel(WarSupportPlayerViewSceneName))
        {
            if (SceneResInfoManager.CurrentActiveInstance)
            {
                backOldSupportSceneName = SceneResInfoManager.CurrentActiveInstance.sceneName;
            }

            AssetBundleManager.LoadLevelAdditive(WarSupportPlayerViewSceneName);

            DeActiveScene(backOldSupportSceneName);

            /*为什么要两帧??因为一个是本帧,另一个才是下一帧..*/
            yield return(new WaitForEndOfFrame());

            yield return(new WaitForFixedUpdate());



            SceneResInfoManager manager = SceneResInfoManager.API_GetSceneResManager(WarSupportPlayerViewSceneName);
            ImageSetting.Apply(true);
            if (manager)
            {
                ActiveScene(WarSupportPlayerViewSceneName);
                manager.SceneRoot.transform.SetPosition(Vector3.one * -999);
            }
            InvokeSceneActiveChangeEvent(WarSupportPlayerViewSceneName);
            isLoadingWarSupportPlayerViewScene = false;
            if (isElaryUnLoadSupportScene)
            {
                isElaryUnLoadSupportScene = false;
                UnLoadWarSupportPlayerViewScene();
                yield break;
            }
            if (null != callBack)
            {
                callBack(manager);
            }
        }
        else
        {
            isLoadingWarSupportPlayerViewScene = false;
        }
    }
Beispiel #2
0
    public static void DeActiveScene(string sceneName)
    {
        if (sceneName.Equals(string.Empty))
        {
            return;
        }
        SceneResInfoManager manager = SceneResInfoManager.API_GetSceneResManager(sceneName);

        if (!manager)
        {
            return;
        }

        if (manager)
        {
            manager.DeActive();
        }
    }