/// <summary> /// NPC 对话ITEM /// </summary> /// <param name="textInfoService"></param> /// <param name="markId"></param> /// <param name="listTextData"></param> public static void GUINpcTextInfoItemForMarkId(TextInfoService textInfoService, long userId, TextTalkTypeEnum talkType, long markId, List <TextInfoBean> listTextData, out List <TextInfoBean> outListTextData) { GUILayout.Space(20); GUILayout.BeginHorizontal(); GUILayout.Label("markId:" + markId, GUILayout.Width(150), GUILayout.Height(20)); if (listTextData.Count > 0) { GUILayout.Label("对话类型:", GUILayout.Width(120), GUILayout.Height(20)); listTextData[0].talk_type = (int)(TextTalkTypeEnum)EditorGUILayout.EnumPopup((TextTalkTypeEnum)listTextData[0].talk_type, GUILayout.Width(100), GUILayout.Height(20)); GUILayout.Label("条件-好感对话:", GUILayout.Width(120), GUILayout.Height(20)); listTextData[0].condition_min_favorability = int.Parse(EditorGUILayout.TextArea(listTextData[0].condition_min_favorability + "", GUILayout.Width(50), GUILayout.Height(20))); } if (listTextData != null) { foreach (TextInfoBean itemTalkInfo in listTextData) { itemTalkInfo.talk_type = listTextData[0].talk_type; itemTalkInfo.condition_min_favorability = listTextData[0].condition_min_favorability; } } if (GUILayout.Button("添加对话", GUILayout.Width(120), GUILayout.Height(20))) { TextInfoBean addText = new TextInfoBean(); addText.mark_id = markId; addText.id = addText.mark_id * 1000 + (listTextData.Count + 1); addText.text_id = addText.id; addText.user_id = listTextData.Count > 0 ? listTextData[0].user_id : userId; addText.valid = 1; addText.text_order = 1; addText.talk_type = listTextData.Count > 0 ? listTextData[0].talk_type : (int)talkType; listTextData.Add(addText); } if (GUILayout.Button("保存当前所有对话", GUILayout.Width(120), GUILayout.Height(20))) { foreach (TextInfoBean itemTalkInfo in listTextData) { textInfoService.UpdateDataById(TextEnum.Talk, itemTalkInfo.id, itemTalkInfo); } } GUILayout.EndHorizontal(); TextInfoBean removeTalkInfo = null; foreach (TextInfoBean itemTalkInfo in listTextData) { GUILayout.BeginHorizontal(); if (GUILayout.Button("更新", GUILayout.Width(120), GUILayout.Height(20))) { textInfoService.UpdateDataById(TextEnum.Talk, itemTalkInfo.id, itemTalkInfo); } if (GUILayout.Button("删除对话", GUILayout.Width(120), GUILayout.Height(20))) { removeTalkInfo = itemTalkInfo; textInfoService.DeleteDataById(TextEnum.Talk, itemTalkInfo.id); } GUILayout.Label("talkId:", GUILayout.Width(100), GUILayout.Height(20)); itemTalkInfo.id = long.Parse(EditorGUILayout.TextArea(itemTalkInfo.id + "", GUILayout.Width(150), GUILayout.Height(20))); itemTalkInfo.text_id = itemTalkInfo.id; GUILayout.Label("对话顺序:", GUILayout.Width(100), GUILayout.Height(20)); itemTalkInfo.text_order = int.Parse(EditorGUILayout.TextArea(itemTalkInfo.text_order + "", GUILayout.Width(50), GUILayout.Height(20))); GUILayout.Label("说话者ID:", GUILayout.Width(100), GUILayout.Height(20)); itemTalkInfo.user_id = EditorUI.GUIEditorText(itemTalkInfo.user_id, 150); itemTalkInfo.type = (int)(TextInfoTypeEnum)EditorGUILayout.EnumPopup((TextInfoTypeEnum)itemTalkInfo.type, GUILayout.Width(100), GUILayout.Height(20)); if (itemTalkInfo.type == (int)TextInfoTypeEnum.Select) { GUILayout.Label("选择类型:", GUILayout.Width(100), GUILayout.Height(20)); itemTalkInfo.select_type = int.Parse(EditorGUILayout.TextArea(itemTalkInfo.select_type + "", GUILayout.Width(50), GUILayout.Height(20))); } else { if (itemTalkInfo.type == (int)TextInfoTypeEnum.Behind) { GUILayout.Label("黑屏时间:", GUILayout.Width(100), GUILayout.Height(20)); itemTalkInfo.wait_time = EditorUI.GUIEditorText(itemTalkInfo.wait_time, 50); } GUILayout.Label("增加的好感:", GUILayout.Width(100), GUILayout.Height(20)); itemTalkInfo.add_favorability = int.Parse(EditorGUILayout.TextArea(itemTalkInfo.add_favorability + "", GUILayout.Width(50), GUILayout.Height(20))); } GUILayout.Label("指定下一句对话:", GUILayout.Width(120), GUILayout.Height(20)); itemTalkInfo.next_order = int.Parse(EditorGUILayout.TextArea(itemTalkInfo.next_order + "", GUILayout.Width(50), GUILayout.Height(20))); GUILayout.Label("触发条件-最低好感:", GUILayout.Width(120), GUILayout.Height(20)); itemTalkInfo.condition_min_favorability = int.Parse(EditorGUILayout.TextArea(itemTalkInfo.condition_min_favorability + "", GUILayout.Width(50), GUILayout.Height(20))); GUILayout.Label("预设名字:", GUILayout.Width(100), GUILayout.Height(20)); itemTalkInfo.name = EditorGUILayout.TextArea(itemTalkInfo.name + "", GUILayout.Width(50), GUILayout.Height(20)); GUILayout.Label("对话内容:", GUILayout.Width(100), GUILayout.Height(20)); itemTalkInfo.content = EditorGUILayout.TextArea(itemTalkInfo.content + "", GUILayout.Width(500), GUILayout.Height(20)); itemTalkInfo.reward_data = EditorUI.GUIListData <RewardTypeEnum>("奖励", itemTalkInfo.reward_data); if (itemTalkInfo.type == (int)TextInfoTypeEnum.Select && itemTalkInfo.select_type == 1) { itemTalkInfo.pre_data = EditorUI.GUIListData <PreTypeEnum>("付出", itemTalkInfo.pre_data); itemTalkInfo.pre_data_minigame = EditorUI.GUIListData <PreTypeForMiniGameEnum>("小游戏数据", itemTalkInfo.pre_data_minigame); } if (GUILayout.Button("更新", GUILayout.Width(120), GUILayout.Height(20))) { textInfoService.UpdateDataById(TextEnum.Talk, itemTalkInfo.id, itemTalkInfo); } if (GUILayout.Button("删除对话", GUILayout.Width(120), GUILayout.Height(20))) { removeTalkInfo = itemTalkInfo; textInfoService.DeleteDataById(TextEnum.Talk, itemTalkInfo.id); } GUILayout.EndHorizontal(); } if (removeTalkInfo != null) { listTextData.Remove(removeTalkInfo); removeTalkInfo = null; } outListTextData = listTextData; }
protected void UIForStoryInfoDetailsTalk(StoryInfoDetailsBean itemData) { if (EditorUI.GUIButton("删除", 200, 20)) { storyInfoService.DeleteDetailsDataByIdOrderType(itemData.story_id, itemData.story_order, itemData.type); listOrderStoryInfoDetails.Remove(itemData); } GUILayout.BeginVertical(); GUILayout.Space(20); GUILayout.BeginHorizontal(); EditorUI.GUIText("对话 ", 120, 20); if (EditorUI.GUIButton("添加子对话", 120, 20)) { if (listStoryTextInfo == null) { listStoryTextInfo = new List <TextInfoBean>(); } TextInfoBean textInfo = new TextInfoBean(); textInfo.id = itemData.text_mark_id * 1000 + listStoryTextInfo.Count + 1; textInfo.text_id = textInfo.id; textInfo.type = 0; textInfo.mark_id = itemData.text_mark_id; textInfo.user_id = 0; textInfo.text_order = listStoryTextInfo.Count + 1; listStoryTextInfo.Add(textInfo); } if (EditorUI.GUIButton("删除所有对话", 120, 20)) { RemoveStoryInfoDetailsItem(itemData); return; } GUILayout.EndHorizontal(); if (listStoryTextInfo != null) { TextInfoBean removeTempText = null; foreach (TextInfoBean textInfo in listStoryTextInfo) { GUILayout.BeginHorizontal(); if (EditorUI.GUIButton("删除子对话", 120, 20)) { removeTempText = textInfo; textInfoService.DeleteDataById(TextEnum.Story, textInfo.id); } if (EditorUI.GUIButton("更新", 120, 20)) { textInfoService.UpdateDataById(TextEnum.Story, textInfo.id, textInfo); } EditorUI.GUIText("ID", 50, 20); textInfo.id = EditorUI.GUIEditorText(textInfo.id, 120, 20); textInfo.type = (int)EditorUI.GUIEnum <TextInfoTypeEnum>("对话类型", textInfo.type, 300, 20); EditorUI.GUIText("对话顺序", 100, 20); textInfo.text_order = int.Parse(EditorUI.GUIEditorText(textInfo.text_order + "", 100, 20)); EditorUI.GUIText("下一对话", 100, 20); textInfo.next_order = int.Parse(EditorUI.GUIEditorText(textInfo.next_order + "", 100, 20)); if (textInfo.type == 0) { EditorUI.GUIText("userID", 100, 20); textInfo.user_id = EditorUI.GUIEditorText(textInfo.user_id, 100, 20); EditorUI.GUIText("姓名", 100, 20); NpcInfoBean npcInfo; if (textInfo.user_id == 0) { npcInfo = new NpcInfoBean(); npcInfo.name = "玩家"; } else { npcInfo = mapNpcInfo[textInfo.user_id]; } EditorUI.GUIText(npcInfo.title_name + "-" + npcInfo.name, 120, 20); EditorUI.GUIText("指定的姓名", 120, 20); textInfo.name = EditorUI.GUIEditorText(textInfo.name, 100, 20); } else if (textInfo.type == 1) { EditorUI.GUIText("select type", 120, 20); textInfo.select_type = int.Parse(EditorUI.GUIEditorText(textInfo.select_type + "", 100, 20)); EditorUI.GUIText("分支选择", 120, 20); if (textInfo.select_type == 0) { EditorUI.GUIText("默认对话", 120, 20); } else { EditorUI.GUIText("分支选项 下一句对话ID", 200, 20); textInfo.next_order = int.Parse(EditorUI.GUIEditorText(textInfo.next_order + "", 100, 20)); } } else if (textInfo.type == 5) { EditorUI.GUIText("黑幕时间", 120, 20); textInfo.wait_time = float.Parse(EditorUI.GUIEditorText(textInfo.wait_time + "", 100, 20)); } EditorUI.GUIText("对话内容", 120, 20); textInfo.content = EditorUI.GUIEditorText(textInfo.content, 400, 20); EditorUI.GUIText("增加的好感:", 120, 20); textInfo.add_favorability = int.Parse(EditorUI.GUIEditorText(textInfo.add_favorability + "", 50, 20)); if (EditorUI.GUIButton("更新", 120, 20)) { textInfoService.UpdateDataById(TextEnum.Story, textInfo.id, textInfo); } textInfo.reward_data = EditorUI.GUIListData <RewardTypeEnum>("奖励", textInfo.reward_data); textInfo.pre_data = EditorUI.GUIListData <PreTypeEnum>("付出", textInfo.pre_data); GUILayout.EndHorizontal(); } if (removeTempText != null) { listStoryTextInfo.Remove(removeTempText); } } GUILayout.EndVertical(); }