Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        return;

        switch (m_Mode)
        {
        case eMode.None:

#if ASSET_BUNDLE_DOWNLOAD
            if (3 == m_InitCounter)
            {
                // データダウンロード以降のシーン
                if (eScene.DataDownload <= m_Scene)
                {
                    AssetBundleMgr.Instance.StartDownload();
                }
                m_InitCounter++;
            }
            else if (4 <= m_InitCounter)
            {
                if (AssetBundleMgr.Instance.Step == AssetBundleMgr.eStep.Idle || AssetBundleMgr.Instance.Step == AssetBundleMgr.eStep.OK)
                {
                    // シーンの初期化
                    SceneBase NowScene = FindObjectOfType <SceneBase>();
                    if (NowScene != null)
                    {
                        NowScene.Init();
                        NowScene.SetInitDone();
                    }
                    ScreenFader.Instance.SetFadeIN(DefaultFadeTime);
                    m_Mode = eMode.Main;
                }
            }
            else
            {
                m_InitCounter++;
            }
#else
            if (3 == m_InitCounter)
            {
                //SaveDataMgr.Instance.Load();
                SpriteBankMgr.Instance.LoadBank(GameDefine.eBank.Common);
//					SoundMgr.Instance.LoadBank( GameDefine.SOUND_BANK_SE );
                //SoundMgr.Instance.LoadBank( GameDefine.SOUND_BANK_JINGLE );


                //DebugMessageView.Create();


                m_InitCounter++;
            }
            else if (4 <= m_InitCounter)
            {
                // シーンの初期化
                SceneBase NowScene = FindObjectOfType <SceneBase>();
                if (NowScene != null)
                {
                    NowScene.LoadSpriteBank();
                    NowScene.LoadBGM();
                }

                m_Mode = eMode.LoadingWait;
            }
            else
            {
                m_InitCounter++;
            }
#endif

            break;

        case eMode.ReadyScene:

            if (SceneManager.GetActiveScene().name == GameDefine.SceneNameTbl[(int)m_NextScene])
            {
                m_Scene     = m_NextScene;
                m_NextScene = GameDefine.eScene.None;

                // シーンの初期化
                SceneBase NowScene = FindObjectOfType <SceneBase>();
                if (NowScene != null)
                {
                    NowScene.LoadSpriteBank();
                    NowScene.LoadBGM();
                }

                m_Mode = eMode.LoadingWait;
            }
            break;

        case eMode.LoadingWait:
        {
            /* moritomi
             *              if( !LayoutFileMgr.isBaseLoadDone )
             *              {
             *                      return;
             *              }
             */

            if (SpriteBankMgr.Instance.isLoading)
            {
                return;
            }
            else
            {
                if (!m_FooterInitDone)
                {
                    m_FooterInitDone = true;
//                        BMFooter.Create();
                    return;
                }


                /*
                 * if (BMFooter.Instance.isLoading)
                 * {
                 *  return;
                 * }
                 */
            }

            /*
             *              if( SoundMgr.Instance.isLoading )
             *              {
             *                      return;
             *              }
             */



            if (!JsonFileMgr.isBaseLoadDone)
            {
                return;
            }
            else
            {
                // Json使う系の初期化
                if (!m_JsonUseInitDone)
                {
                    //TextMgr.Create("TextMgr", transform);
                    //TextMgr.Instance.Init();

                    //CommonValue.Create("CommonValue", transform);
                    //CommonValue.Instance.Init();

                    m_JsonUseInitDone = true;
                }
            }


            SceneBase NowScene = FindObjectOfType <SceneBase>();
            NowScene.Init();


            m_Mode = eMode.InitScene;
        }
        break;

        case eMode.InitScene:
        {
            SceneBase NowScene = FindObjectOfType <SceneBase>();
            if (NowScene.isInitDone)
            {
                NowScene.SetExecFlag();
                ScreenFader.Instance.SetFadeIN(DefaultFadeTime);
                m_Mode = eMode.Main;
            }
        }
        break;

        case eMode.Main:

            // 通常時は30フレーム毎にGC
            if (Time.frameCount % 30 == 0)
            {
                System.GC.Collect();
            }

            break;

        case eMode.ExitScene:

            if (ScreenFader.isFadeEnd)
            {
                m_Mode = eMode.ChangeScene;
            }

            break;

        case eMode.ChangeScene:
            Update_ChangeScene();
            break;
        }
    }