private void ActionScriptCommand(ScriptEngine.Status status, int commandAddress) { if (status == ScriptEngine.Status.EXTERNAL_COMMAND) { if (this.runCommand != null) { this.runCommand.commandAddress = commandAddress; if (!this.runCommand.RunScriptCommand()) { global::Debug.LogWarning("コマンド実行時にエラー発生:プレーンテキスト使用時は " + commandAddress + " 行目"); this.isError = true; } global::Debug.Log(string.Concat(new object[] { "プレーンテキスト使用時は ", commandAddress, " 行目: ", this.runCommand.GetType() })); this.continueCommand = this.runCommand.continueAnalyze; } } else { this.continueCommand = false; this.tutorialCommandAction.ActionScriptCommand(status, commandAddress); } }
public void ActionScriptCommand(ScriptEngine.Status engineStatus, int commandAddress) { this.commandAddress = commandAddress; if (this.actionList.ContainsKey(engineStatus)) { this.actionList[engineStatus](); } }
public void Resume(int waitCommandAddress) { if (waitCommandAddress == this.commandAddress) { this.isWaitCallback = false; if (this.engineStatus != ScriptEngine.Status.EOF) { this.engineStatus = ScriptEngine.Status.NONE; } } }
public void Deserialize(string script) { List <string> allLineList = new List <string>(script.Split(new char[] { '\n' })); this.allCommandList = this.initializer.ConvertAllStrDtsToCommands(allLineList); this.stepAddress = 0; if (this.allCommandList.Count == 0) { this.engineStatus = ScriptEngine.Status.EOF; } }
private void ActionCommandScript(Action <ScriptEngine.Status, int> actionScriptCommand) { while (this.engineStatus == ScriptEngine.Status.NONE) { ScriptCommandData scriptCommandData = this.allCommandList[this.stepAddress]; string[] commandParams = ScriptUtil.SplitByWhiteSpace(scriptCommandData.strArrange); this.AnalyzeCommand(commandParams); this.commandAddress = scriptCommandData.lineNum; this.stepAddress++; } if (actionScriptCommand != null) { actionScriptCommand(this.engineStatus, this.commandAddress); } if (this.allCommandList.Count <= this.stepAddress) { this.engineStatus = ScriptEngine.Status.EOF; } else { this.engineStatus = ScriptEngine.Status.NONE; } }
public ScriptEngine.Status Wait(string[] commandParams) { ScriptEngine.Status result = ScriptEngine.Status.NONE; if (2 > commandParams.Length) { Debug.LogError("引数が足りない"); return(result); } string text = commandParams[1]; switch (text) { case "time": { if (3 > commandParams.Length) { Debug.LogError("引数が足りない"); return(result); } float num2 = ScriptUtil.GetFloat(commandParams[2]); if (0f > num2) { num2 = 0f; } this.commandParams.waitTime = num2; return(ScriptEngine.Status.WAIT_TIME); } case "touch": return(ScriptEngine.Status.WAIT_TOUCH); case "battle_start": return(ScriptEngine.Status.WAIT_BATTLE_START); case "battle_result": return(ScriptEngine.Status.WAIT_BATTLE_RESULT_START); case "battle_action": return(ScriptEngine.Status.WAIT_BATTLE_ACTION_SELECT); case "harvest": if (3 > commandParams.Length) { Debug.LogError("引数が足りない"); return(result); } this.commandParams.meatNum = ScriptUtil.GetInt(commandParams[2]); return(ScriptEngine.Status.WAIT_FARM_HARVEST); case "result_end": return(ScriptEngine.Status.WAIT_BATTLE_RESULT_END); case "first_clear": return(ScriptEngine.Status.WAIT_FIRST_CLEAR); case "level_up": return(ScriptEngine.Status.WAIT_MEAL_LEVEL_UP); case "training_open": return(ScriptEngine.Status.WAIT_OPEN_TRAINING_MENU); case "meal_digimon": return(ScriptEngine.Status.WAIT_OPEN_MEAL_DIGIMON_SELECT); case "meal": return(ScriptEngine.Status.WAIT_OPEN_MEAL_GIVE); case "gasha_top": return(ScriptEngine.Status.WAIT_OPEN_GASHA_TOP); case "detail": if (3 > commandParams.Length) { Debug.LogError("引数が足りない"); return(result); } this.commandParams.waitOpenDetailUI = ScriptUtil.GetIndex(new string[] { "gasha", "evolution" }, commandParams[2]); return(ScriptEngine.Status.WAIT_OPEN_DIGIMON_DETAIL); case "download": return(ScriptEngine.Status.WAIT_DOWNLOAD); case "meat_farm": return(ScriptEngine.Status.WAIT_BUILD_MEAT_FARM); case "digivice_open": return(ScriptEngine.Status.WAIT_DIGIVICE_OPEN); case "digi_garden": return(ScriptEngine.Status.WAIT_DIGI_GARDEN_OPEN); case "digi_garden_list": return(ScriptEngine.Status.WAIT_DIGI_GARDEN_CHANGE_LIST); case "digi_garden_set_list": return(ScriptEngine.Status.WAIT_DIGI_GARDEN_CHANGE_SET_LIST); case "colosseum_open": return(ScriptEngine.Status.WAIT_COLOSSEUM_OPEN); case "build_tap": if (3 > commandParams.Length) { Debug.LogError("引数が足りない"); return(result); } this.commandParams.buildFacilityInfo.id = ScriptUtil.GetInt(commandParams[2]); return(ScriptEngine.Status.WAIT_FARM_BUILD_TAP); case "facility_shop": return(ScriptEngine.Status.WAIT_FACILITY_SHOP_OPEN); case "mission": return(ScriptEngine.Status.WAIT_MISSION_OPEN); } Debug.LogError("引数が対応外"); return(result); }
public void SetStatus(bool isWaitStatus, ScriptEngine.Status status) { this.isWaitCallback = isWaitStatus; this.engineStatus = status; }
private void AnalyzeCommand(string[] commandParams) { string text = commandParams[0]; switch (text) { case "#window": this.commander.Window(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_WINDOW); return; case "#window_del": this.SetStatus(true, ScriptEngine.Status.WAIT_WINDOW_DELETE); return; case "#msg": this.commander.Msg(commandParams); return; case "#text": this.commander.Text(commandParams); return; case "#msgend": this.commander.MsgEnd(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_MESSAGE_DISPLAY); return; case "#select": this.commander.Select(commandParams); return; case "#select_display": this.commander.SelectDisplay(); this.SetStatus(true, ScriptEngine.Status.WAIT_SELECT_DISPLAY); return; case "#chara": this.commander.Chara(commandParams); this.SetStatus(false, ScriptEngine.Status.WAIT_CHARA); return; case "#chara_pos": this.commander.CharaPos(commandParams); this.SetStatus(false, ScriptEngine.Status.SET_CHARA_POS); return; case "#chara_face": this.commander.CharaFace(commandParams); this.SetStatus(false, ScriptEngine.Status.SET_CHARA_FACE); return; case "#chara_del": this.commander.CharaDelete(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_CHARA_DELETE); return; case "#window_pic": this.commander.WindowPicture(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_WINDOW_PICTURE); return; case "#wait": { ScriptEngine.Status status = this.commander.Wait(commandParams); if (status != ScriptEngine.Status.NONE) { this.SetStatus(true, status); } return; } case "#mask": this.commander.Mask(commandParams); this.SetStatus(false, ScriptEngine.Status.SET_MASK_CONTROL); return; case "#fade": this.commander.Fade(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_FADE); return; case "#save": this.commander.Save(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_SAVE); return; case "#scene": this.commander.Scene(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_SCENE); return; case "#shake": this.commander.Shake(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_SHAKE); return; case "#shake_stop": this.commander.ShakeStop(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_SHAKE_STOP); return; case "#ui_set": this.commander.UI(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_UI_SET); return; case "#ui_induce": this.commander.UI_Induce(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_UI_INDUCE); return; case "#ui_push": this.commander.UI(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_UI_PUSH); return; case "#ui_pop": this.commander.UI_Induce(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_UI_POP); return; case "#ui_close": this.SetStatus(true, ScriptEngine.Status.WAIT_UI_CLOSE); return; case "#farm_camera": this.commander.FarmCamera(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_FARM_CAMERA); return; case "#farm_facility": this.commander.FarmSelect(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_FARM_SELECT); return; case "#farm_build": this.commander.FarmBuild(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_FARM_BUILD); return; case "#farm_target": this.commander.FarmTarget(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_FARM_TARGET); return; case "#quest": this.commander.Quest(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_QUEST_SET); return; case "#battle_pause": this.commander.BattlePause(commandParams); this.SetStatus(false, ScriptEngine.Status.SET_BATTLE_PAUSE); return; case "#battle_manual": this.SetStatus(false, ScriptEngine.Status.SET_BATTLE_MANUAL); return; case "#battle_end": this.SetStatus(true, ScriptEngine.Status.SET_BATTLE_END); return; case "#movie": this.SetStatus(true, ScriptEngine.Status.SET_MOVIE); return; case "#sound_volume": this.commander.SoundVolume(commandParams); this.SetStatus(false, ScriptEngine.Status.SET_SOUND_VOLUME); return; case "#bgm": this.commander.Bgm(commandParams); this.SetStatus(false, ScriptEngine.Status.SET_BGM); return; case "#se": this.commander.Se(commandParams); this.SetStatus(false, ScriptEngine.Status.SET_SE); return; case "#digimon": this.commander.Digimon(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_DIGIMON); return; case "#digimon_del": this.SetStatus(false, ScriptEngine.Status.SET_DIGIMON_DELETE); return; case "#effect": this.commander.Effect(commandParams); this.SetStatus(true, ScriptEngine.Status.WAIT_SCREEN_EFFECT); return; case "#battle_auto": this.SetStatus(false, ScriptEngine.Status.SET_BATTLE_AUTO_ON); return; case "#meat": this.commander.Meat(commandParams); this.SetStatus(false, ScriptEngine.Status.SET_MEAT_NUM); return; case "#stone": this.commander.DigiStone(commandParams); this.SetStatus(false, ScriptEngine.Status.SET_DIGI_STONE_NUM); return; case "#digimon_exp": this.commander.DigimonExp(commandParams); this.SetStatus(false, ScriptEngine.Status.SET_DIGIMON_EXP); return; case "#first_tutorial_complete": this.SetStatus(true, ScriptEngine.Status.WAIT_FIRST_TUTORIAL_END); return; case "#download": this.SetStatus(true, ScriptEngine.Status.WAIT_DOWNLOAD_CHECK); return; case "#end": this.SetStatus(false, ScriptEngine.Status.EOF); return; case "#standard_download": this.SetStatus(true, ScriptEngine.Status.START_STANDARD_DOWNLOAD); return; case "#background_download": this.SetStatus(true, ScriptEngine.Status.START_BACKGROUND_DOWNLOAD); return; case "#stop_download": this.SetStatus(true, ScriptEngine.Status.STOP_DOWNLOAD); return; case "#restart_download": this.SetStatus(true, ScriptEngine.Status.RESTART_DOWNLOAD); return; case "#skip": this.SetStatus(false, ScriptEngine.Status.SKIP_START); return; case "#skip_end": this.SetStatus(false, ScriptEngine.Status.SKIP_END); return; case "#battle_skip_end": this.SetStatus(false, ScriptEngine.Status.BATTLE_SKIP_END); return; case "#non_frame_text": this.SetStatus(false, ScriptEngine.Status.SET_NON_FRAME_TEXT); return; case "#non_frame_text_end": this.SetStatus(false, ScriptEngine.Status.SET_NON_FRAME_TEXT_END); return; case "#set_link_point": this.commander.SetLinkPoint(commandParams); this.SetStatus(false, ScriptEngine.Status.SET_LINK_POINT); return; case "#digimon_change": this.SetStatus(true, ScriptEngine.Status.WAIT_DIGIMON_CHANGE); return; } if (this.actionExternalCommand != null && !this.actionExternalCommand(commandParams)) { global::Debug.LogError("未知のコマンド : " + commandParams[0]); } }