private void processingBgmCommand(string currentLine, string originalLine, string commandWord) { var param = CommonLogic.CommandParams(currentLine, originalLine); if (commandWord == CodeCommandWord.FadeInBGM) { if (param.Get("storage") != null) { MainState.Audio.SetBGM(param.Get("storage") ?? "none", 0); MainState.Audio.Vo.ToAudioVolume = CodeToAudioVolume.ON; } else { MainState.Audio.Vo.ToAudioVolume = CodeToAudioVolume.NoChange; } } else if (commandWord == CodeCommandWord.FadeOutBGM) { MainState.Audio.Vo.ToAudioVolume = CodeToAudioVolume.OFF; } MainState.Audio.Vo.BGM_STATUS = CodeBgmStatus.Start; }
/// <summary> /// コマンド実行 /// 処理中はfalse、処理が終わればtrueで次の行へ /// </summary> /// <returns><c>true</c>, if command was done, <c>false</c> otherwise.</returns> /// <param name="currentLine">Current line.</param> private bool DoCommand(CommandArgs args, bool loadFlag = false) { var currentLine = args.CurrentLine; var originalLine = args.OriginalLine; //コマンド実行前に初期化 Ref.ctl.textArea.GetComponent <GUIText>().text = string.Empty; Ref.ctl.textAreaShadow.GetComponent <GUIText>().text = string.Empty; //コマンドを取得 var commandWord = CommonLogic.GetCommandWord(currentLine); //想定したコマンドであれば処理開始 //トランジション系コマンド if (commandWord == CodeCommandWord.Jump) { var param = CommonLogic.CommandParams(currentLine, currentLine); MainState.Scenario.Jump(param.Get("storage"), param.Get("target")); } else if (CodeCommandWord.ToTransitionList().Contains(commandWord)) { //処理 CommonLogic.Command.Transition(currentLine, MainState); //テキストの透過度はメッセージウィンドウに依存 Ref.ctl.textArea.SetTextAlpha(Ref.ctl.messageWindow.GetAlpha() * 2); Ref.ctl.textAreaShadow.SetTextAlpha(Ref.ctl.messageWindow.GetAlpha() * 2); //コマンド トランジションが終わったら裏レイヤを削除 //trueを返して処理終了 if (MainState.Camera.Vo.COMMAND_STATUS == CodeCommandStatus.Done) { // 裏側の立ち絵と背景を透明化 Ref.ctlBack.Reset(); //この処理を入れないと、コピーするたびに背景が下がり、そのうち-10(カメラ)を突破してしまい、表示されなくなる var outPosition = Ref.ctl.bgGround.transform.position; Ref.ctl.bgGround.transform.position = new Vector3(outPosition.x, outPosition.y, 0); MainState.Camera.Vo.COMMAND_STATUS = CodeCommandStatus.Start; MainState.Camera.Vo.BackMessageAppear = CodeBackMessageAppear.NoChange; return(true); } ; } //音楽セット、フェード開始フラグON else if (CodeCommandWord.ToAudioList().Contains(commandWord)) { processingBgmCommand(currentLine, originalLine, commandWord); return(true); } //@s 停止タグ else if (commandWord == CodeCommandWord.S) { return(false); } else if (commandWord == CodeCommandWord.Video) { // ロードによる読み飛ばし中は、動画は読み込まない if (loadFlag) { return(true); } //既に同じMovieNameが入っている=動画が終了した次のフレームで、またここに来た var param = CommonLogic.CommandParams(currentLine, originalLine); MainState.Movie.Vo.MoviePlayFlag = CodeMoviePlayFlag.START; MainState.Movie.Vo.MovieName = (param.Get("storage") ?? ""); Resources.UnloadUnusedAssets(); System.GC.Collect(2); return(true); } else if (commandWord == CodeCommandWord.GameClear) { MainState.Config.GameClear(); return(true); } //非トランジション系コマンド else if (CodeCommandWord.ToList().Contains(commandWord)) { //処理 CommonLogic.Command.SetLayers(currentLine, originalLine, MainState); //テキストの透過度はメッセージウィンドウに依存 Ref.ctl.textArea.SetTextAlpha(Ref.ctl.messageWindow.GetAlpha() * 2); Ref.ctl.textAreaShadow.SetTextAlpha(Ref.ctl.messageWindow.GetAlpha() * 2); return(true); } //それ以外はエラー else { return(true); } return(false); }