예제 #1
0
    void Update_ChangeScene()
    {
        switch (m_Step)
        {
        case eChangeSceneStep.CallVoidScene:
            //SaveDataMgr.Instance.Save();
            SceneManager.LoadScene("SceneChange", LoadSceneMode.Single);
            m_Step = eChangeSceneStep.UnloadAsset;
            break;

        case eChangeSceneStep.UnloadAsset:
            if (SceneManager.GetActiveScene().name != "SceneChange")
            {
                return;
            }
            CanvasMgr.Instance.SceneChange();
            SpriteBankMgr.Instance.UnloadBankSceneEnd();
            Resources.UnloadUnusedAssets();
            //AssetBundleMgr.Instance.UnloadUnuseAll(false);
            //TextureMgr.Instance.UnloadUnuseAll(false);
            m_Step = eChangeSceneStep.GC;
            break;

        case eChangeSceneStep.GC:
            System.GC.Collect();
            m_Step = eChangeSceneStep.End;
            break;

        case eChangeSceneStep.End:
            SceneManager.LoadScene(GameDefine.SceneNameTbl[(int)m_NextScene], LoadSceneMode.Single);
            m_Mode = eMode.ReadyScene;
            break;
        }
    }
예제 #2
0
    public bool ChangeScene(GameDefine.eScene NextScene, bool isFade, Color FadeColor, float FadeTime)
    {
        if (m_Mode != eMode.Main)
        {
            Debug.Log("ChangeSceneError: シーンの変異はすでに始まっているため上書きできません。");
            return(false);
        }

        m_Step      = eChangeSceneStep.CallVoidScene;
        m_NextScene = NextScene;

        if (isFade)
        {
            m_Mode = eMode.ExitScene;
            ScreenFader.Instance.SetFadeOut(FadeColor, FadeTime);
        }
        else
        {
            m_Mode = eMode.ChangeScene;
        }
        return(true);
    }