Example #1
0
        //一ページ内のコマンド処理
        IEnumerator CoStartPage(AdvScenarioLabelData labelData, AdvScenarioPageData pageData, AdvCommand returnToCommand, bool skipPageHeaer)
        {
            if (pageData.CheckSkipByLocalize())
            {
                yield break;
            }

            int        index   = skipPageHeaer ? pageData.IndexTextTopCommand : 0;
            AdvCommand command = pageData.GetCommand(index);

            if (returnToCommand != null)
            {
                while (command != returnToCommand)
                {
                    command = pageData.GetCommand(++index);
                }
            }

            //復帰直後はIf内分岐は無効
            if (IfManager.OldSaveDataStart)
            {
                index   = pageData.GetIfSkipCommandIndex(index);
                command = pageData.GetCommand(index);
            }

            //ページ冒頭の状態をセーブデータとして記憶
            if (EnableSaveOnPageTop() && pageData.EnableSave)
            {
                SkipPageHeaerOnSave = false;
                Engine.SaveManager.UpdateAutoSaveData(Engine);
            }
            //システムパラメーターの変更があった場合にシステムセーブデータとして記憶
            CheckSystemDataWriteIfChanged();

            while (command != null)
            {
                if (command.IsEntityType)
                {
                    //エンティティコマンドの場合は、コマンドを作り直して差し替え
                    command = AdvEntityData.CreateEntityCommand(command, Engine, pageData);
                }

                //ifスキップチェック
                if (IfManager.CheckSkip(command))
                {
                    if (ScenarioPlayer.DebugOutputLog)
                    {
                        Debug.Log("Command If Skip: " + command.GetType() + " " + labelData.ScenarioLabel + ":" + pageData.PageNo);
                    }
                    command = pageData.GetCommand(++index);
                    continue;
                }

                currentCommand = command;
                //ロード
                command.Load();

                //テキスト表示開始時におけるオートセーブ
                if (EnableSaveTextTop() && pageData.EnableSaveTextTop(command))
                {
                    SkipPageHeaerOnSave = true;
                    //オートセーブデータ作成
                    Engine.SaveManager.UpdateAutoSaveData(Engine);
                    //システムパラメーターの変更があった場合にシステムセーブデータとして記憶
                    CheckSystemDataWriteIfChanged();
                }

                //ロード待ち
                while (!command.IsLoadEnd())
                {
                    IsLoading = true;
                    yield return(null);
                }
                IsLoading = false;

                //コマンド実行
                command.CurrentTread = this;
                if (ScenarioPlayer.DebugOutputLog)
                {
                    Debug.Log("Command : " + command.GetType() + " " + labelData.ScenarioLabel + ":" + pageData.PageNo);
                }
                ScenarioPlayer.OnBeginCommand.Invoke(command);
                command.DoCommand(Engine);

                //コマンド実行後にファイルをアンロード
                command.Unload();
                command.CurrentTread = null;

                while (ScenarioPlayer.IsPausing)
                {
                    yield return(null);
                }
                //コマンドの処理待ち
                while (true)
                {
                    command.CurrentTread = this;
                    ScenarioPlayer.OnUpdatePreWaitingCommand.Invoke(command);
                    if (!command.Wait(Engine))
                    {
                        break;
                    }
                    if (ScenarioPlayer.DebugOutputWaiting)
                    {
                        Debug.Log("Wait..." + command.GetType());
                    }
                    ScenarioPlayer.OnUpdateWaitingCommand.Invoke(command);
                    command.CurrentTread = null;
                    yield return(null);
                }
                command.CurrentTread = this;
                if (ScenarioPlayer.DebugOutputCommandEnd)
                {
                    Debug.Log("End :" + command.GetType() + " " + labelData.ScenarioLabel + ":" + pageData.PageNo);
                }
                ScenarioPlayer.OnEndCommand.Invoke(command);
                command.CurrentTread = null;

                Engine.UiManager.IsInputTrig       = false;
                Engine.UiManager.IsInputTrigCustom = false;

                if (IsBreakCommand)
                {
                    yield break;
                }
                command = pageData.GetCommand(++index);
            }
        }
        //一ページ内のコマンド処理
        IEnumerator CoStartPage(AdvScenarioLabelData labelData, AdvScenarioPageData pageData, int page)
        {
            int        index   = 0;
            AdvCommand command = pageData.GetCommand(index);

            while (command != null)
            {
                //古いセーブデータのロード中はページ末までスキップ
                if (IsOldVersion && !command.IsTypePageEnd())
                {
                    command = pageData.GetCommand(++index);
                    continue;
                }

                //ifスキップチェック
                if (IfManager.CheckSkip(command))
                {
                    if ((debugOutPut & DebugOutPut.Log) == DebugOutPut.Log)
                    {
                        Debug.Log("Command If Skip: " + command.GetType() + " " + labelData.ScenaioLabel + ":" + page);
                    }
                    command = pageData.GetCommand(++index);
                    continue;
                }

                //ロード
                command.Load();

                //ロード待ち
                while (!command.IsLoadEnd())
                {
                    isWaitLoading = true;
                    yield return(0);
                }
                isWaitLoading = false;

                //コマンド実行
                if ((debugOutPut & DebugOutPut.Log) == DebugOutPut.Log)
                {
                    Debug.Log("Command : " + command.GetType() + " " + labelData.ScenaioLabel + ":" + page);
                }
                command.DoCommand(engine);
                ///ページ末端・オートセーブデータを更新
//				if (command.IsTypePageEnd())
//				{
//					///ページ開始処理
//					engine.Page.BeginPage(currentScenarioLabel, currentPage);
//					engine.SaveManager.UpdateAutoSaveData(engine);
//				}

                //コマンド実行後にファイルをアンロード
                command.Unload();

                //コマンドの処理待ち
                while (command.Wait(engine))
                {
                    if ((debugOutPut & DebugOutPut.Waiting) == DebugOutPut.Waiting)
                    {
                        Debug.Log("Wait..." + command.GetType());
                    }
                    yield return(0);
                }

                if ((debugOutPut & DebugOutPut.CommandEnd) == DebugOutPut.CommandEnd)
                {
                    Debug.Log("End :" + command.GetType() + " " + labelData.ScenaioLabel + ":" + page);
                }

                if (IsBreakCommand)
                {
                    yield break;
                }
                command = pageData.GetCommand(++index);
            }
        }
Example #3
0
        //一ページ内のコマンド処理
        IEnumerator CoStartPage(AdvScenarioLabelData labelData, AdvScenarioPageData pageData, AdvCommand returnToCommand)
        {
            int        index   = 0;
            AdvCommand command = pageData.GetCommand(index);

            if (returnToCommand != null)
            {
                while (command != returnToCommand)
                {
                    command = pageData.GetCommand(++index);
                }
            }

            //復帰直後はIf内分岐は無効
            if (IfManager.IsLoadInit)
            {
                index   = pageData.GetIfSkipCommandIndex(index);
                command = pageData.GetCommand(index);
            }

            while (command != null)
            {
                if (command.IsEntityType)
                {
                    command = command.CreateEntityCommand(Engine, pageData);
                }

                //古いセーブデータのロード中はページ末までスキップ
                if (IsOldVersion && !command.IsTypePageEnd())
                {
                    command = pageData.GetCommand(++index);
                    continue;
                }

                //ifスキップチェック
                if (IfManager.CheckSkip(command))
                {
                    if ((debugOutPut & DebugOutPut.Log) == DebugOutPut.Log)
                    {
                        Debug.Log("Command If Skip: " + command.GetType() + " " + labelData.ScenaioLabel + ":" + pageData.PageNo);
                    }
                    command = pageData.GetCommand(++index);
                    continue;
                }

                currentCommand = command;
                //ロード
                command.Load();

                //ロード待ち
                while (!command.IsLoadEnd())
                {
                    isWaitLoading = true;
                    yield return(0);
                }
                isWaitLoading = false;

                //コマンド実行
                if ((debugOutPut & DebugOutPut.Log) == DebugOutPut.Log)
                {
                    Debug.Log("Command : " + command.GetType() + " " + labelData.ScenaioLabel + ":" + pageData.PageNo);
                }
                this.OnBeginCommand.Invoke(command);
                command.DoCommand(engine);
                ///ページ末端・オートセーブデータを更新
//				if (command.IsTypePageEnd())
//				{
//					///ページ開始処理
//					engine.Page.BeginPage(currentScenarioLabel, currentPage);
//					engine.SaveManager.UpdateAutoSaveData(engine);
//				}

                //コマンド実行後にファイルをアンロード
                command.Unload();

                while (IsPausing)
                {
                    yield return(0);
                }
                //コマンドの処理待ち
                while (true)
                {
                    this.OnUpdatePreWaitingCommand.Invoke(command);
                    if (!command.Wait(engine))
                    {
                        break;
                    }
                    if ((debugOutPut & DebugOutPut.Waiting) == DebugOutPut.Waiting)
                    {
                        Debug.Log("Wait..." + command.GetType());
                    }
                    this.OnUpdateWaitingCommand.Invoke(command);
                    yield return(0);
                }
                if ((debugOutPut & DebugOutPut.CommandEnd) == DebugOutPut.CommandEnd)
                {
                    Debug.Log("End :" + command.GetType() + " " + labelData.ScenaioLabel + ":" + pageData.PageNo);
                }
                this.OnEndCommand.Invoke(command);

                Engine.UiManager.IsInputTrig       = false;
                Engine.UiManager.IsInputTrigCustom = false;

                if (IsBreakCommand)
                {
                    yield break;
                }
                command = pageData.GetCommand(++index);
            }
        }