Ejemplo n.º 1
0
 public void SDK_MomoryClean()
 {
     PlayerAsseMgr.ClearAll();
     EffectAssetMgr.ClearAll();
     Resources.UnloadUnusedAssets();
     Debug.Log("SDK_MomoryClean");
 }
Ejemplo n.º 2
0
    public static void LoadingAsyncScene(string name, SwitchScenEffect type = SwitchScenEffect.LoadingBar, bool withUI = true, bool withDynRes = false, bool manualClose = false, bool resetLocker = false)
    {
        if (GlobalValue.isBattleScene(name))
        {
            GamePlayer.Instance.isInBattle = true;
        }
        else
        {
            GamePlayer.Instance.isInBattle = false;
        }

        GameManager.Instance.EnableDelayCheck(false);
        GuideManager.Instance.ClearMask();
        GlobalInstanceFunction.Instance.ClearInvokeRepeat();

        PlayerAsseMgr.ClearAll();
        EffectAssetMgr.ClearAll();
        Resources.UnloadUnusedAssets();
        if (Loading || ScenePreloader.Instance.DiffSceneLoad(name))
        {
            wait4LoadQue_.Clear();
            WaitLoadInfo wli = new WaitLoadInfo();
            wli.name_        = name;
            wli.type_        = type;
            wli.withUI_      = withUI;
            wli.withDynRes_  = withDynRes;
            wli.manualClose_ = manualClose;
            wli.resetLocker_ = resetLocker;
            wait4LoadQue_.Enqueue(wli);
            return;
        }

        Loading = true;

        if (resetLocker)
        {
            GameManager.Instance.reconnectionLocker_ = false;
        }
        ApplicationEntry.Instance.switchSceneMask_.SetActive(true);

        if (OnSceneBeginLoad != null)
        {
            OnSceneBeginLoad();
        }

        UIManager.Instance.DoDeActive();
        withUI_      = withUI;
        withDynRes_  = withDynRes;
        manualClose_ = manualClose;
        preScene_    = Scene_name;
        Scene_name   = name;
        Loadtype     = type;

        if (Scene_name.Equals(GlobalValue.StageName_ReLoginScene))
        {
            GameManager.Instance.ClearCurrentState();
        }

        if (type == SwitchScenEffect.LoadingBar)
        {
            UIFactory.Instance.LoadUIPanel(UIASSETS_ID.UIASSETS_LoadingPanel, () => {
                UIFactory.Instance.CloseCurrentUI();
                UIFactory.Instance.OpenUI(UIASSETS_ID.UIASSETS_LoadingPanel, menuTypes.Popup);
                ApplicationEntry.Instance.switchSceneMask_.SetActive(false);
            });
        }
        else
        {
            GlobalInstanceFunction.LoadSceneUI(Scene_name, () => {
                ShowGame.Instance.ShowScenEffect(type);
            });
        }
        Prebattle.Instance.ClearAssetLoadCount();
        sendSceneLoaded_ = false;
    }