예제 #1
0
        //ページ情報の初期化
        internal void InitPages()
        {
            if (CommnadList.Count <= 0)
            {
                return;
            }

            this.pageDataList.Clear();

            {
                AdvScenarioPageData page = new AdvScenarioPageData(this, this.PageDataList.Count);
                pageDataList.Add(page);
                for (int i = 0; i < CommnadList.Count; ++i)
                {
                    AdvCommand command = CommnadList[i];
                    page.AddCommand(command);
                    //ページデータの作成(ページ末端判定にも使うのでここで行う)
                    command.MakePageData(page);
                    //ページが最後かチェック
                    if (command.IsTypePageEnd() && i + 1 < CommnadList.Count)
                    {
                        page = new AdvScenarioPageData(this, this.PageDataList.Count);
                        pageDataList.Add(page);
                    }
                }
            }

            foreach (AdvScenarioPageData page in pageDataList)
            {
                page.Init();
            }
        }
예제 #2
0
        /// <summary>
        /// ページ冒頭の初期化
        /// </summary>
        /// <param name="scenarioName">シナリオラベル</param>
        /// <param name="pageNo">ページ名</param>
        public void BeginPage(AdvScenarioPageData currentPageData)
        {
            this.LastInputSendMessage = false;
            this.CurrentData          = currentPageData;
            this.CurrentTextLength    = 0;
            this.CurrentTextLengthMax = 0;
            this.deltaTimeSendMessage = 0;
            this.Contoller.Clear();
            this.TextData      = new TextData(CurrentData.MakeText());
            this.SaveDataTitle = CurrentData.ScenarioLabelData.SaveTitle;
            if (string.IsNullOrEmpty(this.SaveDataTitle))
            {
                this.SaveDataTitle = TextData.NoneMetaString;
            }

            UpdateText();

            this.OnBeginPage.Invoke(this);
            Engine.UiManager.OnBeginPage();
            Engine.MessageWindowManager.ChangeCurrentWindow(currentPageData.MessageWindowName);
            if (!currentPageData.IsEmptyText)
            {
                //バックログを追加
                Engine.BacklogManager.AddPage();
            }
        }
예제 #3
0
 //ページ用のデータからコマンドに必要な情報を初期化
 public override void InitFromPageData(AdvScenarioPageData pageData)
 {
     this.PageData      = pageData;
     this.IndexPageData = PageData.TextDataList.Count;
     PageData.AddTextData(this);
     PageData.InitMessageWindowName(this, ParseCellOptional <string>(AdvColumnName.WindowType, ""));
 }
예제 #4
0
        /// <summary>
        /// ページ冒頭の初期化
        /// </summary>
        /// <param name="scenarioName">シナリオラベル</param>
        /// <param name="pageNo">ページ名</param>
        public void BeginPage(AdvScenarioPageData cuurentPageData)
        {
            this.CurrentData          = cuurentPageData;
            this.CurrentTextLength    = 0;
            this.CurrentTextLengthMax = 0;
            this.deltaTimeSendMessage = 0;
            this.Contoller.Clear();
            this.TextData      = new TextData(CurrentData.MakeText());
            this.SaveDataTitle = CurrentData.ScenarioLabelData.SaveTitle;
            if (string.IsNullOrEmpty(this.SaveDataTitle))
            {
                this.SaveDataTitle = TextData.NoneMetaString;
            }

            UpdateText();

            this.OnBeginPage.Invoke(this);
            Engine.UiManager.OnBeginPage();
            Engine.MessageWindowManager.ChangeCurrentWindow(cuurentPageData.MessageWindowName);
            if (!cuurentPageData.IsEmptyText)
            {
                Engine.BacklogManager.AddPage();
            }

            //ページ冒頭の状態をセーブデータとして記憶
            Engine.SaveManager.UpdateAutoSaveData(engine);
            //パラメーターの変更があった場合にシステムセーブデータとして記憶
            if (Engine.Param.HasChangedSystemParam)
            {
                Engine.Param.HasChangedSystemParam = false;
                Engine.SystemSaveData.Write();
            }
        }
예제 #5
0
 //ページ用のデータからコマンドに必要な情報を初期化
 public override void InitFromPageData(AdvScenarioPageData pageData)
 {
     if (names.Count > 0)
     {
         pageData.InitMessageWindowName(this, names[0]);
     }
 }
 //コマンドの追加
 public void AddCommand(AdvCommand command)
 {
     cuurentPageData.AddCommand(command);
     if (command.IsTypePageEnd())
     {
         cuurentPageData = new AdvScenarioPageData();
         pageDataList.Add(cuurentPageData);
     }
 }
		//コマンドの追加
		public void AddCommand(AdvCommand command)
		{
			cuurentPageData.AddCommand(command);
			if (command.IsTypePageEnd())
			{
				cuurentPageData = new AdvScenarioPageData();
				pageDataList.Add(cuurentPageData);
			}
		}
예제 #8
0
 //選択肢テキストなどほかのテキストのコマンドをチェック
 void CheckOtherTextCommand(AdvScenarioPageData page, IAdvMessageWindowCaracterCountChecker messageWindow)
 {
     foreach (var item in page.CommandList)
     {
         var selection = item as AdvCommandSelection;
         if (selection != null)
         {
             selection.ParseCellLocalizedText();
         }
     }
 }
예제 #9
0
 //ページデータを描画
 void OnGuiPage(AdvScenarioPageData page)
 {
     if (page == null)
     {
         UtageEditorToolKit.BoldLabel("Not found page data");
     }
     else
     {
         EditorGUILayout.BeginVertical(WindowStyle);
         page.CommnadList.ForEach(x => OnGuiCommand(x));
         EditorGUILayout.EndVertical();
     }
 }
예제 #10
0
        string MakeText(AdvScenarioPageData page)
        {
            StringBuilder builder = new StringBuilder();

            foreach (var item in page.TextDataList)
            {
                builder.Append(item.ParseCellLocalizedText());
                if (item.IsNextBr)
                {
                    builder.Append("\n");
                }
            }
            return(builder.ToString());
        }
예제 #11
0
        // 1ページの文字数をカウントしてチェック
        int CheckCharacterCount(AdvScenarioPageData page, IAdvMessageWindowCaracterCountChecker messageWindow)
        {
            string text = MakeText(page);

            if (text.Length <= 0)
            {
                return(0);
            }
            int    count;
            string errorString;

            if (!messageWindow.TryCheckCaracterCount(text, out count, out errorString))
            {
                Debug.LogError("TextOver:" + page.TextDataList[0].RowData.ToStringOfFileSheetLine() + "\n" + errorString);
            }
            return(count);
        }
예제 #12
0
        // 1ページの文字数をカウントしてチェック
        int CheckCharacterCount(AdvScenarioPageData page, ref string currentWindowName)
        {
            IAdvMessageWindowCaracterCountChecker messageWindow;

            if (!string.IsNullOrEmpty(page.MessageWindowName))
            {
                currentWindowName = page.MessageWindowName;
            }

            if (!Windows.TryGetValue(currentWindowName, out messageWindow))
            {
                foreach (var window in Windows.Values)
                {
                    messageWindow = window;
                    break;
                }
            }

            //アクティブオフ状態だったらOnにしておく
            bool isActive = messageWindow.gameObject.activeSelf;

            messageWindow.gameObject.SetActive(true);

            //ローカライズに対応
            UguiLocalizeBase[] localizeArray = messageWindow.gameObject.GetComponentsInChildren <UguiLocalizeBase>();
            foreach (var item in localizeArray)
            {
                item.EditorRefresh();
            }

            //文字数をカウント
            int count = CheckCharacterCount(page, messageWindow);

            //選択肢テキストなどほかのテキストのコマンドをチェック
            CheckOtherTextCommand(page, messageWindow);

            //ローカライズ状態を戻す
            foreach (var item in localizeArray)
            {
                item.ResetDefault();
            }
            //アクテイブ状態をもどす
            messageWindow.gameObject.SetActive(isActive);
            return(count);
        }
예제 #13
0
        //今のコマンドから、エンティティ処理したコマンドを作成
        public AdvCommand CreateEntityCommand(AdvEngine engine, AdvScenarioPageData pageData)
        {
            StringGridRow row;

            if (!TryParseRowDataEntity(this.OriginalRowData, engine.Param.GetParameter, out row))
            {
                return(this);
            }

            AdvCommand command = AdvCommandParser.CreateCommand(row, engine.DataManager.SettingDataManager);

            if (this.TextDataInPage != null)
            {
                command.InitTextDataInPage(this.TextDataInPage);
                this.TextDataInPage.Command = command;
            }
            return(command);
        }
예제 #14
0
        /// <summary>
        /// ページ冒頭の初期化
        /// </summary>
        /// <param name="scenarioName">シナリオラベル</param>
        /// <param name="pageNo">ページ名</param>
        public void BeginPage(AdvScenarioPageData currentPageData)
        {
            this.LastInputSendMessage = false;
            this.CurrentData          = currentPageData;
            this.CurrentTextLength    = 0;
            this.CurrentTextLengthMax = 0;
            this.deltaTimeSendMessage = 0;
            this.Contoller.Clear();
            this.TextData = new TextData("");
            this.TextDataList.Clear();
            UpdateText();
            RemakeTextData();
            this.SaveDataTitle = CurrentData.ScenarioLabelData.SaveTitle;
            if (string.IsNullOrEmpty(this.SaveDataTitle))
            {
                switch (TitleType)
                {
                case SaveTitleType.Log:
                    this.SaveDataTitle = TextData.MakeLogText(TextData.OriginalText);
                    break;

                case SaveTitleType.LogNoneMeta:
                    this.SaveDataTitle = new TextData(TextData.MakeLogText(TextData.OriginalText)).NoneMetaString;
                    break;

                case SaveTitleType.Default:
                default:
                    this.SaveDataTitle = TextData.OriginalText;
                    break;
                }
            }

            this.OnBeginPage.Invoke(this);
            Engine.UiManager.OnBeginPage();
            if (!currentPageData.ExistsWindowInitCommand())
            {
                Engine.MessageWindowManager.ChangeCurrentWindow(currentPageData.MessageWindowName);
            }
            if (!currentPageData.IsEmptyText)
            {
                //バックログを追加
                Engine.BacklogManager.AddPage();
            }
        }
예제 #15
0
 //ページ用のデータを作成
 public virtual void MakePageData(AdvScenarioPageData pageData)
 {
 }
예제 #16
0
 //ページ用のデータを作成
 public override void MakePageData(AdvScenarioPageData pageData)
 {
     pageData.InitMessageWindowName(this, name);
 }
예제 #17
0
 //ページ用のデータを作成
 public override void MakePageData(AdvScenarioPageData pageData)
 {
     InitTextDataInPage(pageData.AddTextDataInPage(this));
     pageData.InitMessageWindowName(this, ParseCellOptional <string>(AdvColumnName.WindowType, ""));
 }
		void Init(string scenaioLabel)
		{
			this.scenaioLabel = scenaioLabel;
			cuurentPageData = new AdvScenarioPageData();
			pageDataList.Add(cuurentPageData);
		}
예제 #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);
            }
        }
        //指定のシナリオを再生
        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();
        }
예제 #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);
            }
        }
예제 #22
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();
        }
 public override void InitFromPageData(AdvScenarioPageData pageData)
 {
     this.scenarioLabel          = pageData.ScenarioLabelData.ScenarioLabel;
     this.subroutineCommandIndex = pageData.ScenarioLabelData.CountSubroutineCommandIndex(this);
 }
예제 #24
0
 //ページ用のデータを作成
 public override void MakePageData(AdvScenarioPageData pageData)
 {
     InitTextDataInPage(pageData.AddTextDataInPage(this));
 }
예제 #25
0
 //ページ用のデータからコマンドに必要な情報を初期化
 public virtual void InitFromPageData(AdvScenarioPageData pageData)
 {
 }
		//一ページ内のコマンド処理
		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);
            }
        }
예제 #28
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();
        }
 void Init(string scenaioLabel)
 {
     this.scenaioLabel = scenaioLabel;
     cuurentPageData   = new AdvScenarioPageData();
     pageDataList.Add(cuurentPageData);
 }
예제 #30
0
        //今のコマンドから、エンティティ処理したコマンドを作成
        public static AdvCommand CreateEntityCommand(AdvCommand original, AdvEngine engine, AdvScenarioPageData pageData)
        {
            StringGridRow row = new StringGridRow(original.RowData.Grid, original.RowData.RowIndex);

            row.DebugIndex = original.RowData.DebugIndex;

            string[] strings = original.EntityData.CreateCommandStrings(engine.Param.GetParameter);
            row.InitFromStringArray(strings);
            AdvCommand entityCommand = AdvCommandParser.CreateCommand(original.Id, row, engine.DataManager.SettingDataManager);

            if (entityCommand is AdvCommandText)
            {
                AdvCommandText textCommand = entityCommand as AdvCommandText;
                textCommand.InitOnCreateEntity(original as AdvCommandText);
            }
            return(entityCommand);
        }
 public override void InitFromPageData(AdvScenarioPageData pageData)
 {
     pageData.InitMessageWindowName(this, this.name);
 }