Exemplo n.º 1
0
        //シナリオラベルデータを表示
        void OnScnearioLabelData(AdvScenarioLabelData data)
        {
            if (data == null)
            {
                UtageEditorToolKit.BoldLabel("Not found scenario data");
            }
            else
            {
                //エディタ上のビュワーで表示するラベル
                string viewerLabel = "*" + data.ScenaioLabel + "   " + data.FileLabel;
                if (currentCommand != null && currentCommand.RowData != null)
                {
                    viewerLabel += " : " + currentCommand.RowData.RowIndex;
                }
                GUILayout.Label(viewerLabel);

                //位置を記憶しておく
                if (Event.current.type == EventType.Repaint)
                {
                    Rect rect = GUILayoutUtility.GetLastRect();
                    scrollTopY = rect.y + rect.height;
                }

                this.scrollPosition2 = EditorGUILayout.BeginScrollView(this.scrollPosition2);
                data.PageDataList.ForEach(x => OnGuiPage(x));
                EditorGUILayout.EndScrollView();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// シナリオラベルのリンクチェック
        /// </summary>
        /// <param name="label">シナリオラベル</param>
        /// <returns>あればtrue。なければfalse</returns>
        void ErrorCheckScenarioLabel(List <AdvScenarioData> scenarioList)
        {
            //リンク先のシナリオラベルがあるかチェック
            foreach (AdvScenarioData data in scenarioList)
            {
                foreach (AdvScenarioJumpData jumpData in data.JumpDataList)
                {
                    if (!IsExistScenarioLabel(jumpData.ToLabel))
                    {
                        Debug.LogError(
                            jumpData.FromRow.ToErrorString(
                                LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.NotLinkedScenarioLabel, jumpData.ToLabel, "")
                                ));
                    }
                }
            }

            //シナリオラベルが重複しているかチェック
            foreach (AdvScenarioData data in scenarioList)
            {
                foreach (var keyValue in data.ScenarioLabels)
                {
                    AdvScenarioLabelData labelData = keyValue.Value;
                    if (IsExistScenarioLabel(labelData.ScenarioLabel, data))
                    {
                        string error = labelData.ToErrorString(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.RedefinitionScenarioLabel, labelData.ScenarioLabel, ""), data.DataGridName);
                        Debug.LogError(error);
                    }
                }
            }
        }
Exemplo n.º 3
0
        //シナリオラベル区切りのデータを作成
        void MakeScanerioLabelData(List <AdvCommand> commandList)
        {
            //最初のラベル区切りデータは自身の名前(シート名)
            AdvScenarioLabelData currentScenariodata = new AdvScenarioLabelData(Name);

            scenarioLabelData.Add(currentScenariodata);

            //シナリオラベルの解析
            foreach (AdvCommand command in commandList)
            {
                ///シナリオラベルを取得
                string scenarioLabel = command.GetScenarioLabel();
                if (!string.IsNullOrEmpty(scenarioLabel))
                {
                    if (IsContainsScenarioLabel(scenarioLabel))
                    {
                        Debug.LogError(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.RedefinitionScenarioLabel, scenarioLabel, DataGridName));
                    }
                    else
                    {
                        currentScenariodata = new AdvScenarioLabelData(scenarioLabel, command.RowData);
                        scenarioLabelData.Add(currentScenariodata);
                    }
                }
                currentScenariodata.AddCommand(command);

                ///このシナリオからリンクするジャンプ先のシナリオラベルを取得
                string jumpLabel = command.GetJumpLabel();
                if (!string.IsNullOrEmpty(jumpLabel))
                {
                    jumpScenarioData.Add(new AdvScenarioJumpData(jumpLabel, command.RowData));
                }
            }
        }
Exemplo n.º 4
0
 public AdvScenarioPageData(AdvScenarioLabelData scenarioLabelData, int pageNo, List <AdvCommand> commandList)
 {
     this.TextDataList      = new List <AdvCommandText>();
     this.ScenarioLabelData = scenarioLabelData;
     this.PageNo            = pageNo;
     this.CommandList       = commandList;
 }
Exemplo n.º 5
0
        //指定のページ移行のファイルをプリロード
        internal HashSet <AssetFile> MakePreloadFileListSub(AdvDataManager dataManager, int page, int maxFilePreload, int preloadDeep)
        {
            AdvScenarioLabelData data    = this;
            HashSet <AssetFile>  fileSet = new HashSet <AssetFile>();

            do
            {
                for (int j = page; j < data.PageNum; ++j)
                {
                    data.GetPageData(j).AddToFileSet(fileSet);
                    if (fileSet.Count >= maxFilePreload)
                    {
                        return(fileSet);
                    }
                }
                //ジャンプなどがあるので、このページでいったん先読みの区切り
                if (data.IsEndPreLoad())
                {
                    //ジャンプ先もプリロードする
                    data.PreloadDeep(dataManager, page, fileSet, maxFilePreload, preloadDeep);
                    break;
                }
                page = 0;
                data = data.Next;
            } while (data != null);
            return(fileSet);
        }
        public AdvScenarioLabelData FindNextScenarioLabelData(string scenarioLabel)
        {
            AdvScenarioLabelData data = this.FindScenarioLabelData(scenarioLabel);

            if (data != null)
            {
                return(data.Next);
            }
            return(null);
        }
Exemplo n.º 7
0
        //シナリオラベル区切りのデータを作成
        void MakeScanerioLabelData(List <AdvCommand> commandList)
        {
            if (commandList.Count <= 0)
            {
                return;
            }

            //最初のラベル区切りデータは自身の名前(シート名)
            string scenarioLabel = Name;
            AdvCommandScenarioLabel scenarioLabelCommand = null;
            AdvScenarioLabelData    scenarioLabelData    = null;
            int commandIndex = 0;

            do
            {
                int begin = commandIndex;
                //コマンドを追加
                while (commandIndex < commandList.Count)
                {
                    //シナリオラベルがあるので、終了
                    if (commandList[commandIndex] is AdvCommandScenarioLabel)
                    {
                        break;
                    }
                    ++commandIndex;
                }

                if (IsContainsScenarioLabel(scenarioLabel))
                {
                    //重複してないかチェック
                    Debug.LogError(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.RedefinitionScenarioLabel, scenarioLabel, DataGridName));
                }
                else
                {
                    //ラベルデータ追加
                    AdvScenarioLabelData next = new AdvScenarioLabelData(scenarioLabel, scenarioLabelCommand, commandList.GetRange(begin, commandIndex - begin));
                    if (scenarioLabelData != null)
                    {
                        scenarioLabelData.Next = next;
                    }
                    scenarioLabelData = next;
                    scenarioLabels.Add(scenarioLabel, next);
                }

                if (commandIndex >= commandList.Count)
                {
                    break;
                }

                scenarioLabelCommand = commandList[commandIndex] as AdvCommandScenarioLabel;
                scenarioLabel        = scenarioLabelCommand.ScenarioLabel;
                ++commandIndex;
            } while (true);
        }
Exemplo n.º 8
0
        // 1シナリオラベルデータ内の文字数をカウントしてチェック
        int CheckCharacterCount(AdvScenarioLabelData data)
        {
            int    count             = 0;
            string currentWindowName = "";

            foreach (AdvScenarioPageData page in data.PageDataList)
            {
                count += CheckCharacterCount(page, ref currentWindowName);
            }
            return(count);
        }
Exemplo n.º 9
0
 public AdvScenarioLabelData NextScenarioLabelData(string scenarioLabel)
 {
     foreach (AdvScenarioData data in scenarioDataTbl.Values)
     {
         AdvScenarioLabelData labelData = data.FindNextScenarioLabelData(scenarioLabel);
         if (labelData != null)
         {
             return(labelData);
         }
     }
     return(null);
 }
Exemplo n.º 10
0
        //シナリオラベル区切りのデータを作成
        void MakeScanerioLabelData(List <AdvCommand> commandList)
        {
            if (commandList.Count <= 0)
            {
                return;
            }

            //最初のラベル区切りデータは自身の名前(シート名)
            AdvScenarioLabelData data = new AdvScenarioLabelData(Name, null);
            int commandIndex          = 0;

            while (true)
            {
                //重複してないかチェック
                if (IsContainsScenarioLabel(data.ScenaioLabel))
                {
                    Debug.LogError(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.RedefinitionScenarioLabel, data.ScenaioLabel, DataGridName));
                    break;
                }
                scenarioLabelData.Add(data);

                //コマンドを追加
                while (commandIndex < commandList.Count)
                {
                    AdvCommand command = commandList[commandIndex];
                    //シナリオラベルがあるので、終了
                    if (!string.IsNullOrEmpty(command.GetScenarioLabel()))
                    {
                        break;
                    }
                    data.AddCommand(command);
                    ///このシナリオからリンクするジャンプ先のシナリオラベルを取得
                    string[] jumpLabels = command.GetJumpLabels();
                    if (jumpLabels != null)
                    {
                        foreach (var jumpLabel in jumpLabels)
                        {
                            jumpScenarioData.Add(new AdvScenarioJumpData(jumpLabel, command.RowData));
                        }
                    }
                    ++commandIndex;
                }
                //ページデータの初期化処理
                data.InitPages();
                if (commandIndex >= commandList.Count)
                {
                    break;
                }
                data = new AdvScenarioLabelData(commandList[commandIndex].GetScenarioLabel(), commandList[commandIndex] as AdvCommandScenarioLabel);
                ++commandIndex;
            }
        }
Exemplo n.º 11
0
        public AdvScenarioLabelData FindNextScenarioLabelData(string scenarioLabel)
        {
            AdvScenarioLabelData current = FindScenarioLabelData(scenarioLabel);

            if (current != null)
            {
                return(current.Next);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 12
0
        //サブルーチンの帰り先を見つけて情報を設定
        internal void SetSubroutineRetunInfo(string scenarioLabel, int subroutineCommandIndex, SubRoutineInfo info)
        {
            foreach (AdvScenarioData data in scenarioDataTbl.Values)
            {
                AdvScenarioLabelData labelData = data.FindScenarioLabelData(scenarioLabel);
                if (labelData == null)
                {
                    continue;
                }

                labelData.SetSubroutineRetunInfo(subroutineCommandIndex, info);
                break;
            }
        }
Exemplo n.º 13
0
        //指定のシナリオラベルの指定ページから最大ファイル数先読み
        public HashSet <AssetFile> MakePreloadFileList(string scenarioLabel, int page, int maxFilePreload, int preloadDeep)
        {
            foreach (AdvScenarioData data in scenarioDataTbl.Values)
            {
                if (data.IsContainsScenarioLabel(scenarioLabel))
                {
                    AdvScenarioLabelData label = data.FindScenarioLabelData(scenarioLabel);
                    if (label == null)
                    {
                        return(null);
                    }

                    return(label.MakePreloadFileListSub(this, page, maxFilePreload, preloadDeep));
                }
            }
            return(null);
        }
        private void MakeScanerioLabelData(List <AdvCommand> commandList)
        {
            if (commandList.Count <= 0)
            {
                return;
            }
            string name = this.Name;
            AdvCommandScenarioLabel scenarioLabelCommand = null;
            AdvScenarioLabelData    data = null;
            int num = 0;

            while (true)
            {
                int index = num;
                while (num < commandList.Count)
                {
                    if (commandList[num] is AdvCommandScenarioLabel)
                    {
                        break;
                    }
                    num++;
                }
                if (this.IsContainsScenarioLabel(name))
                {
                    object[] args = new object[] { name, this.DataGridName };
                    Debug.LogError(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.RedefinitionScenarioLabel, args));
                }
                else
                {
                    AdvScenarioLabelData data2 = new AdvScenarioLabelData(name, scenarioLabelCommand, commandList.GetRange(index, num - index));
                    if (data != null)
                    {
                        data.Next = data2;
                    }
                    data = data2;
                    this.scenarioLabels.Add(name, data2);
                }
                if (num >= commandList.Count)
                {
                    return;
                }
                scenarioLabelCommand = commandList[num] as AdvCommandScenarioLabel;
                name = scenarioLabelCommand.ScenarioLabel;
                num++;
            }
        }
Exemplo n.º 15
0
        HashSet <AssetFile> MakePreloadFileListSub(int index, int page, int maxFilePreload)
        {
            HashSet <AssetFile> fileList = new HashSet <AssetFile>();

            for (int i = index; i < ScenarioLabelData.Count; ++i)
            {
                AdvScenarioLabelData data = ScenarioLabelData[i];
                for (int j = page; j < data.PageNum; ++j)
                {
                    data.GetPageData(j).AddToFileSet(fileList);
                    if (fileList.Count >= maxFilePreload)
                    {
                        return(fileList);
                    }
                }
                page = 0;
            }
            return(fileList);
        }
Exemplo n.º 16
0
        //サブルーチンの帰り先を見つけて情報を設定
        internal void SetSubroutineRetunInfo(string scenarioLabel, int subroutineCommandIndex, SubRoutineInfo info)
        {
            foreach (AdvScenarioData data in scenarioDataTbl.Values)
            {
                AdvScenarioLabelData labelData = data.FindScenarioLabelData(scenarioLabel);
                if (labelData == null)
                {
                    continue;
                }

                if (!labelData.TrySetSubroutineRetunInfo(subroutineCommandIndex, info))
                {
                    AdvScenarioLabelData nextData = NextScenarioLabelData(scenarioLabel);

                    info.ReturnLabel   = nextData.ScenarioLabel;
                    info.ReturnPageNo  = 0;
                    info.ReturnCommand = null;
                }
                break;
            }
        }
		//シナリオラベル区切りのデータを作成
		void MakeScanerioLabelData( List<AdvCommand> commandList)
		{
			//最初のラベル区切りデータは自身の名前(シート名)
			AdvScenarioLabelData currentScenariodata = new AdvScenarioLabelData(Name);
			scenarioLabelData.Add(currentScenariodata);

			//シナリオラベルの解析
			foreach (AdvCommand command in commandList)
			{
				///シナリオラベルを取得
				string scenarioLabel = command.GetScenarioLabel();
				if (!string.IsNullOrEmpty(scenarioLabel) )
				{
					if (IsContainsScenarioLabel(scenarioLabel))
					{
						Debug.LogError(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.RedefinitionScenarioLabel, scenarioLabel,DataGridName));
					}
					else
					{
						currentScenariodata = new AdvScenarioLabelData(scenarioLabel,command.RowData);
						scenarioLabelData.Add(currentScenariodata);
					}
				}
				currentScenariodata.AddCommand(command);

				///このシナリオからリンクするジャンプ先のシナリオラベルを取得
				string jumpLabel = command.GetJumpLabel();
				if (!string.IsNullOrEmpty(jumpLabel))
				{
					jumpScenarioData.Add(new AdvScenarioJumpData(jumpLabel, command.RowData));
				}
			}
		}
        //指定のシナリオを再生
        IEnumerator CoStartScenario(string label, int page)
        {
            //ジャンプ先のシナリオラベルのログを出力
            if ((debugOutPut & DebugOutPut.Log) == DebugOutPut.Log)
            {
                Debug.Log("Jump : " + label + " :" + page);
            }

            //ジャンプ直後は1フレーム遅らせないと、ジャンプコマンドが正常に動作しない
//			yield return 0;

            //起動時のロード待ち
            while (Engine.IsLoading)
            {
                yield return(0);
            }


            //シナリオロード待ち
            isWaitLoading = true;
            while (!Engine.DataManager.IsLoadEndScenarioLabel(label))
            {
                yield return(0);
            }
            isWaitLoading = false;

            //各データをリセット
            Reset();

            if (page < 0)
            {
                page = 0;
            }
            //ページ指定がある場合はif分岐の設定をしておく
            if (page != 0)
            {
                ifManager.IsLoadInit = true;
            }

            //ジャンプ先のシナリオデータを取得
            AdvScenarioLabelData currentLabelData = Engine.DataManager.FindScenarioLabelData(label);

            while (currentLabelData != null)
            {
                UpdateSceneGallery(currentLabelData.ScenaioLabel, engine);
                AdvScenarioPageData cuurentPageData = currentLabelData.GetPageData(page);
                //ページデータを取得
                while (cuurentPageData != null)
                {
                    //プリロードを更新
                    UpdatePreLoadFiles(currentLabelData.ScenaioLabel, page);

                    ///ページ開始処理
                    Engine.Page.BeginPage(currentLabelData.ScenaioLabel, page);
                    Engine.SaveManager.UpdateAutoSaveData(engine);

                    var pageCoroutine = StartCoroutine(CoStartPage(currentLabelData, cuurentPageData, page));
                    if (pageCoroutine != null)
                    {
                        yield return(pageCoroutine);
                    }
                    while (Engine.EffectManager.IsPageWaiting)
                    {
                        yield return(0);
                    }

                    //古いバージョンのロード処理は終了
                    IsOldVersion = false;

                    ///改ページ処理
                    if (true)
                    {
                        //ボイスを止める
                        if (Engine.Config.VoiceStopType == VoiceStopType.OnClick)
                        {
                            Engine.SoundManager.StopVoice();
                        }

                        Engine.SystemSaveData.ReadData.AddReadPage(engine.Page.ScenarioLabel, page);
                        Engine.Page.EndPage();
                    }
                    if (IsBreakCommand)
                    {
                        if (IsReservedEndScenario)
                        {
                            break;
                        }
                        if (JumpManager.IsLabeled)
                        {
                            JumpToLabelReserved();
                        }
                        yield break;
                    }

                    cuurentPageData = currentLabelData.GetPageData(++page);
                }
                if (IsReservedEndScenario)
                {
                    break;
                }
                //ロード直後処理終了
                IfManager.IsLoadInit = false;
                currentLabelData     = Engine.DataManager.NextScenarioLabelData(currentLabelData.ScenaioLabel);
                page = 0;
            }
            EndScenario();
        }
Exemplo n.º 19
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);
            }
        }
Exemplo n.º 20
0
 public AdvScenarioPageData(AdvScenarioLabelData scenarioLabelData, int pageNo)
 {
     TextDataList      = new List <AdvScenarioTextDataInPage>();
     ScenarioLabelData = scenarioLabelData;
     PageNo            = pageNo;
 }
Exemplo n.º 21
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);
			}
		}
        //一ページ内のコマンド処理
        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);
            }
        }
Exemplo n.º 24
0
        //指定のシナリオを再生
        IEnumerator CoStartScenario(string label, int page, AdvCommand returnToCommand)
        {
            IsPlayingScenario = true;
            //ジャンプ先のシナリオラベルのログを出力
            if ((debugOutPut & DebugOutPut.Log) == DebugOutPut.Log)
            {
                Debug.Log("Jump : " + label + " :" + page);
            }

            //起動時のロード待ち
            while (Engine.IsLoading)
            {
                yield return(0);
            }


            //シナリオロード待ち
            isWaitLoading = true;
            while (!Engine.DataManager.IsLoadEndScenarioLabel(label))
            {
                yield return(0);
            }
            isWaitLoading = false;

            //各データをリセット
            ResetOnJump();

            if (page < 0)
            {
                page = 0;
            }
            //ページ指定がある場合はif分岐の設定をしておく
            if (page != 0)
            {
                ifManager.IsLoadInit = true;
            }

            //ジャンプ先のシナリオデータを取得
            AdvScenarioLabelData currentLabelData = Engine.DataManager.FindScenarioLabelData(label);

            while (currentLabelData != null)
            {
                UpdateSceneGallery(currentLabelData.ScenaioLabel, engine);
                AdvScenarioPageData cuurentPageData = currentLabelData.GetPageData(page);
                //ページデータを取得
                while (cuurentPageData != null)
                {
                    //プリロードを更新
                    UpdatePreLoadFiles(currentLabelData.ScenaioLabel, page);

                    ///ページ開始処理
                    Engine.Page.BeginPage(cuurentPageData);

                    //0フレーム即コルーチンが終わる場合を考えてこう書く
                    var pageCoroutine = StartCoroutine(CoStartPage(currentLabelData, cuurentPageData, returnToCommand));
                    if (pageCoroutine != null)
                    {
                        yield return(pageCoroutine);
                    }
                    currentCommand  = null;
                    returnToCommand = null;
                    while (Engine.EffectManager.IsPageWaiting)
                    {
                        yield return(0);
                    }

                    //古いバージョンのロード処理は終了
                    IsOldVersion = false;

                    ///改ページ処理
                    Engine.Page.EndPage();
                    if (IsBreakCommand)
                    {
                        if (IsReservedEndScenario)
                        {
                            break;
                        }
                        if (JumpManager.IsReserved)
                        {
                            JumpToReserved();
                        }
                        yield break;
                    }

                    cuurentPageData = currentLabelData.GetPageData(++page);
                }
                if (IsReservedEndScenario)
                {
                    break;
                }
                //ロード直後処理終了
                IfManager.IsLoadInit = false;
                currentLabelData     = Engine.DataManager.NextScenarioLabelData(currentLabelData.ScenaioLabel);
                page = 0;
            }
            EndScenario();
        }
Exemplo n.º 25
0
        //指定のシナリオを再生
        IEnumerator CoStartScenario(string label, int page, AdvCommand returnToCommand, bool skipPageHeaer)
        {
            IsPlaying           = true;
            SkipPageHeaerOnSave = false;
            //ジャンプ先のシナリオラベルのログを出力
            if (ScenarioPlayer.DebugOutputLog)
            {
                Debug.Log("Jump : " + label + " :" + page);
            }

            //起動時のロード待ち
            while (Engine.IsLoading)
            {
                yield return(null);
            }


            //シナリオロード待ち
            IsLoading = true;
            while (!Engine.DataManager.IsLoadEndScenarioLabel(label))
            {
                yield return(null);
            }
            IsLoading = false;

            //各データをリセット
            ResetOnJump();

            if (page < 0)
            {
                page = 0;
            }

            //セーブデータにサブスレッドがある場合に再開
            LoadSubThreadSaveData();


            //ジャンプ先のシナリオデータを取得
            AdvScenarioLabelData currentLabelData = Engine.DataManager.FindScenarioLabelData(label);

            while (currentLabelData != null)
            {
                ScenarioPlayer.UpdateSceneGallery(currentLabelData.ScenarioLabel, Engine);
                AdvScenarioPageData currentPageData = currentLabelData.GetPageData(page);
                //ページデータを取得
                while (currentPageData != null)
                {
                    //プリロードを更新
                    UpdatePreLoadFiles(currentLabelData.ScenarioLabel, page);

                    ///ページ開始処理
                    if (IsMainThread)
                    {
                        Engine.Page.BeginPage(currentPageData);
                    }

                    //0フレーム即コルーチンが終わる場合を考えてこう書く
                    var pageCoroutine = StartCoroutine(CoStartPage(currentLabelData, currentPageData, returnToCommand, skipPageHeaer));
                    if (pageCoroutine != null)
                    {
                        yield return(pageCoroutine);
                    }
                    currentCommand  = null;
                    returnToCommand = null;
                    skipPageHeaer   = false;
                    //ページ終了処理
                    if (IsMainThread)
                    {
                        Engine.Page.EndPage();
                    }
                    if (IsBreakCommand)
                    {
                        if (IsMainThread && ScenarioPlayer.IsReservedEndScenario)
                        {
                            ScenarioPlayer.EndScenario();
                            yield break;
                        }
                        else
                        {
                            if (JumpManager.IsReserved)
                            {
                                JumpToReserved();
                                yield break;
                            }
                            else
                            {
                                OnEndThread();
                                yield break;
                            }
                        }
                    }
                    currentPageData = currentLabelData.GetPageData(++page);
                }
                //ロード直後処理終了
                IfManager.OldSaveDataStart = false;
                currentLabelData           = Engine.DataManager.NextScenarioLabelData(currentLabelData.ScenarioLabel);
                page = 0;
            }
            OnEndThread();
        }