/// <summary> /// 烹饪游戏剧情触发 /// </summary> /// <param name="gameCookingData"></param> /// <param name="id"></param> public bool EventTriggerForStoryCooking(MiniGameCookingBean gameCookingData, long id) { StoryInfoBean storyInfo = StoryInfoHandler.Instance.manager.GetStoryInfoDataById(id); if (storyInfo == null) { return(false); } this.storyInfo = storyInfo; SetEventStatus(EventStatusEnum.EventIng); SetEventType(EventTypeEnum.StoryForMiniGameCooking); //控制模式修改 BaseControl baseControl = GameControlHandler.Instance.StartControl <ControlForStoryCpt>(GameControlHandler.ControlEnum.Story); baseControl.transform.position = new Vector3(storyInfo.position_x, storyInfo.position_y); UIHandler.Instance.manager.CloseAllUI(); //设置文本的回调 UIGameText uiGameText = UIHandler.Instance.manager.GetUI <UIGameText>(UIEnum.GameText); uiGameText.SetCallBack(this); //设置文本的备用数据 SortedList <string, string> listMarkData = GetMiniGameMarkStrData(gameCookingData); uiGameText.SetListMark(listMarkData); StoryInfoHandler.Instance.builderForStory.BuildStory(storyInfo); return(true); }
/// <summary> /// 提交按钮 /// </summary> public void OnClickSubmit() { UIGameText uiGameText = (UIGameText)uiComponent; GameDataBean gameData = GameDataHandler.Instance.manager.GetGameData(); AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal); //检测是否启用小游戏 if (CheckUtil.StringIsNull(textData.pre_data_minigame)) { List <PreTypeBean> listPre = PreTypeEnumTools.GetListPreData(textData.pre_data); foreach (PreTypeBean itemPreData in listPre) { PreTypeEnumTools.GetPreDetails(itemPreData, gameData); if (!itemPreData.isPre) { ToastHandler.Instance.ToastHint(itemPreData.spPreIcon, itemPreData.preFailStr); return; } } //完成前置条件 PreTypeEnumTools.CompletePre(listPre, gameData); //完成所有奖励 RewardTypeEnumTools.CompleteReward(null, textData.reward_data); uiGameText.SelectText(textData); } else { DialogBean dialogBean = new DialogBean(); PickForCharacterDialogView dialogView = DialogHandler.Instance.CreateDialog <PickForCharacterDialogView>(DialogEnum.PickForCharacter, this, dialogBean); PreTypeForMiniGameEnumTools.GetPlayerNumber(textData.pre_data_minigame, out int playerNumber); dialogView.SetPickCharacterMax(playerNumber); } }
/// <summary> /// 剧情触发 /// </summary> /// <param name="markId"></param> public bool EventTriggerForStory(StoryInfoBean storyInfo) { if (!CheckEventTrigger()) { return(false); } this.storyInfo = storyInfo; SetEventStatus(EventStatusEnum.EventIng); SetEventType(EventTypeEnum.Story); //暂停时间 GameTimeHandler.Instance.SetTimeStop(); //控制模式修改 BaseControl baseControl = GameControlHandler.Instance.StartControl <ControlForStoryCpt>(GameControlHandler.ControlEnum.Story); baseControl.transform.position = new Vector3(storyInfo.position_x, storyInfo.position_y); //隐藏重要NPC if (NpcHandler.Instance.buildForImportant != null) { NpcHandler.Instance.buildForImportant.HideNpc(); } if (NpcHandler.Instance.builderForFamily != null) { NpcHandler.Instance.builderForFamily.HideNpc(); } UIHandler.Instance.manager.CloseAllUI(); //设置文本的回调 UIGameText uiGameText = UIHandler.Instance.manager.GetUI <UIGameText>(UIEnum.GameText); uiGameText.SetCallBack(this); StoryInfoHandler.Instance.builderForStory.BuildStory(storyInfo); return(true); }
public bool HandleForTalk(StoryInfoDetailsBean itemData) { //进入对话; UIGameText uiComponent = UIHandler.Instance.manager.OpenUIAndCloseOther <UIGameText>(UIEnum.GameText); uiComponent.SetData(TextEnum.Story, itemData.text_mark_id); return(false); }
/// <summary> /// 设置文本数据 /// </summary> /// <param name="content"></param> public void SetText(string content) { UIGameText uiGameText = (UIGameText)uiComponent; if (tvContent != null && uiGameText != null) { string contentDetails = uiGameText.SetContentDetails(content); tvContent.text = contentDetails; } }
public void Submit(DialogView dialogView, DialogBean dialogBean) { if (CheckUtil.StringIsNull(textData.pre_data_minigame)) { return; } UIGameText uiGameText = (UIGameText)uiComponent; PickForCharacterDialogView pickDialog = dialogView as PickForCharacterDialogView; if (uiGameText.callBack != null) { uiGameText.callBack.UITextSelectResult(textData, pickDialog.GetPickCharacter()); } }
/// <summary> /// 调查事件触发 /// </summary> /// <param name="markId"></param> public bool EventTriggerForLook(long markId) { if (!CheckEventTrigger()) { return(false); } SetEventStatus(EventStatusEnum.EventIng); SetEventType(EventTypeEnum.Look); //暂停时间 GameTimeHandler.Instance.SetTimeStop(); //控制模式修改 GameControlHandler.Instance.StopControl(); UIGameText uiGameText = UIHandler.Instance.manager.OpenUIAndCloseOther <UIGameText>(UIEnum.GameText); uiGameText.SetCallBack(this); uiGameText.SetData(TextEnum.Look, markId); return(true); }
/// <summary> /// 对话事件触发 /// </summary> /// <param name="markId"></param> public bool EventTriggerForTalk(NpcInfoBean npcInfo, bool isStopTime) { if (!CheckEventTrigger()) { return(false); } SetEventStatus(EventStatusEnum.EventIng); SetEventType(EventTypeEnum.Talk); //暂停时间 if (isStopTime) { GameTimeHandler.Instance.SetTimeStop(); } //控制模式修改 GameControlHandler.Instance.StopControl(); UIGameText uiGameText = UIHandler.Instance.manager.OpenUIAndCloseOther <UIGameText>(UIEnum.GameText); uiGameText.SetDataForTalk(npcInfo); uiGameText.SetCallBack(this); return(true); }