Exemple #1
0
        /** [シングルトン]constructor
         */
        private Scene()
        {
            //current
            this.current = null;

            //request
            this.request = null;

            //is_scene
            this.is_scene = false;

            //mode
            this.mode  = Mode.WaitRequest;
            this.first = true;

            //PlayerLoopType
            this.playerloop_flag = true;
            Fee.PlayerLoopSystem.PlayerLoopSystem.GetInstance().Add(Config.PLAYERLOOP_ADDTYPE, Config.PLAYERLOOP_TARGETTYPE, typeof(PlayerLoopType.Fee_Scene_Main), this.Main);

            //gameobject
            this.gameobject = new UnityEngine.GameObject("scene");
            UnityEngine.GameObject.DontDestroyOnLoad(this.gameobject);
            this.gameobject.AddComponent <Fee.Function.UnityUpdate_MonoBehaviour>().SetCallBack(this, 0);
            this.gameobject.AddComponent <Fee.Function.UnityLateUpdate_MonoBehaviour>().SetCallBack(this, 0);
            this.gameobject.AddComponent <Fee.Function.UnityFixedUpdate_MonoBehaviour>().SetCallBack(this, 0);
        }
Exemple #2
0
        /** [シングルトン]constructor
         */
        private Scene()
        {
            //current
            this.current = null;

            //request
            this.request = null;

            //is_scene
            this.is_scene = false;

            //mode
            this.mode = Mode.WaitRequest;
        }
Exemple #3
0
        /** 更新。
         */
        public void Main()
        {
            switch (this.mode)
            {
            case Mode.WaitRequest:
            {
                //リクエスト待ち。

                if (this.current == null)
                {
                    if (this.request != null)
                    {
                        this.current = this.request;
                        this.request = null;

                        Tool.Log("Scene", "this.current = this.request");
                    }
                }

                if (this.current != null)
                {
                    if (this.current.SceneStart() == true)
                    {
                        this.is_scene = true;
                        this.mode     = Mode.Main;
                    }
                }
            } break;

            case Mode.Main:
            {
                //メイン。

                if (this.current != null)
                {
                    if (this.current.Main() == true)
                    {
                        this.mode = Mode.SceneEnd;
                    }
                }
            } break;

            case Mode.SceneEnd:
            {
                //シーン終了

                if (this.current != null)
                {
                    if (this.current.SceneEnd() == true)
                    {
                        this.is_scene = false;
                        this.current.Delete();
                        this.current = null;
                        this.mode    = Mode.WaitRequest;

                        Tool.Log("Scene", "this.current = null;");
                    }
                }
            } break;
            }
        }
Exemple #4
0
 /** 次のシーン。設定。
  */
 public void SetNextScene(Scene_Base a_scene)
 {
     this.request = a_scene;
 }
Exemple #5
0
        /** Main
         */
        private void Main()
        {
            try{
                if (this.playerloop_flag == true)
                {
                    switch (this.mode)
                    {
                    case Mode.WaitRequest:
                    {
                        //リクエスト待ち。

                        if (this.current == null)
                        {
                            if (this.request != null)
                            {
                                this.current = this.request;
                                this.request = null;

                                Tool.Log("Scene", "this.current = this.request");
                            }
                        }

                        if (this.current != null)
                        {
                            if (this.current.SceneStart(this.first) == true)
                            {
                                this.is_scene = true;
                                this.mode     = Mode.Main;
                            }
                            else
                            {
                                this.first = false;
                            }
                        }
                    } break;

                    case Mode.Main:
                    {
                        //メイン。

                        if (this.current != null)
                        {
                            if (this.current.Main() == true)
                            {
                                this.mode  = Mode.SceneEnd;
                                this.first = true;
                            }
                        }
                    } break;

                    case Mode.SceneEnd:
                    {
                        //シーン終了

                        if (this.current != null)
                        {
                            if (this.current.SceneEnd(this.first) == true)
                            {
                                this.is_scene = false;
                                this.current.Delete();
                                this.current = null;
                                this.first   = true;
                                this.mode    = Mode.WaitRequest;

                                Tool.Log("Scene", "this.current = null;");
                            }
                            else
                            {
                                this.first = false;
                            }
                        }
                    } break;
                    }
                }
            }catch (System.Exception t_exception) {
                Tool.DebugReThrow(t_exception);
            }
        }