|
@@ -29,7 +29,8 @@ public class DialogueManager : Singleton<DialogueManager>
|
|
|
/// <summary>
|
|
|
/// 开始对话
|
|
|
/// </summary>
|
|
|
- public async CTask StartDialogue(AccountFileInfo.EventList CurrentEventList, int dialogueID, int eventId, Action onComplete = null, Action onCancel = null)
|
|
|
+ public async CTask StartDialogue(AccountFileInfo.EventList CurrentEventList, int dialogueID, int eventId,
|
|
|
+ Action onComplete = null, Action onCancel = null)
|
|
|
{
|
|
|
this.onCancel = onCancel;
|
|
|
this.CurrentEventList = CurrentEventList;
|
|
@@ -42,7 +43,7 @@ public class DialogueManager : Singleton<DialogueManager>
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- await PlayDialogue(dialogueID,true);
|
|
|
+ await PlayDialogue(dialogueID, true);
|
|
|
}
|
|
|
|
|
|
// EndDialogue1();
|
|
@@ -56,7 +57,8 @@ public class DialogueManager : Singleton<DialogueManager>
|
|
|
//神识探索的事件记录步骤
|
|
|
if (EventSystemManager.Instance.CurrentEventList != null)
|
|
|
{
|
|
|
- EventConfig eventConfig = ConfigComponent.Instance.Get<EventConfig>(EventSystemManager.Instance.CurrentEventList.eventID);
|
|
|
+ EventConfig eventConfig =
|
|
|
+ ConfigComponent.Instance.Get<EventConfig>(EventSystemManager.Instance.CurrentEventList.eventID);
|
|
|
if (eventConfig.EventLinksId.Contains(currentDialogueID))
|
|
|
{
|
|
|
EventSystemManager.Instance.CurrentEventList.curStep = currentDialogueID;
|
|
@@ -67,7 +69,7 @@ public class DialogueManager : Singleton<DialogueManager>
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private async CTask PlayDialogue(int dialogueID,bool isShowTips = false)
|
|
|
+ private async CTask PlayDialogue(int dialogueID, bool isShowTips = false)
|
|
|
{
|
|
|
currentDialogueID = dialogueID;
|
|
|
|
|
@@ -79,9 +81,10 @@ public class DialogueManager : Singleton<DialogueManager>
|
|
|
if (CurrentEventList != null)
|
|
|
{
|
|
|
var eventLinkDatas = CurrentEventList.eventLinks.FirstOrDefault(el => el.eventLinkId == dialogueID);
|
|
|
- if (eventLinkDatas != null && !EventSystemManager.Instance.CeekEventGroupComplete(eventLinkDatas.eventConditions))
|
|
|
+ if (eventLinkDatas != null &&
|
|
|
+ !EventSystemManager.Instance.CeekEventGroupComplete(eventLinkDatas.eventConditions))
|
|
|
{
|
|
|
- if(isShowTips)
|
|
|
+ if (isShowTips)
|
|
|
EventTipsPanel.OpenPanel(eventLinkDatas);
|
|
|
onCancel?.Invoke();
|
|
|
return;
|
|
@@ -99,7 +102,8 @@ public class DialogueManager : Singleton<DialogueManager>
|
|
|
EventNPC eventNpc = ConfigComponent.Instance.Get<EventNPC>(dialogueConfig.NPCID);
|
|
|
if (eventNpc.ID != 0 && eventNpc.DaoyouID != 0)
|
|
|
{
|
|
|
- if (AccountFileInfo.Instance.playerData.daoYouDatas.FirstOrDefault(dy => dy.id == eventNpc.DaoyouID) == null)
|
|
|
+ if (AccountFileInfo.Instance.playerData.daoYouDatas.FirstOrDefault(dy => dy.id == eventNpc.DaoyouID) ==
|
|
|
+ null)
|
|
|
{
|
|
|
AccountFileInfo.DaoYouData daoYouData = new AccountFileInfo.DaoYouData();
|
|
|
daoYouData.id = eventNpc.DaoyouID;
|
|
@@ -135,7 +139,8 @@ public class DialogueManager : Singleton<DialogueManager>
|
|
|
{
|
|
|
if (dialogueConfig.LanID != null)
|
|
|
{
|
|
|
- await DialoguePanel.OpenDialoguePanel(CurrentEventList, dialogueConfig.ID, null, ShowDialogueEventData.MessageShowType.Verbatim,
|
|
|
+ await DialoguePanel.OpenDialoguePanel(CurrentEventList, dialogueConfig.ID, null,
|
|
|
+ ShowDialogueEventData.MessageShowType.Verbatim,
|
|
|
FishDialogue);
|
|
|
}
|
|
|
else
|
|
@@ -153,8 +158,16 @@ public class DialogueManager : Singleton<DialogueManager>
|
|
|
{
|
|
|
if (selectedOptionID.HasValue && selectedOptionID.Value != -1)
|
|
|
{
|
|
|
- // 玩家选择了选项,处理结果
|
|
|
- SelectOption(selectedOptionID.Value);
|
|
|
+ if (selectedOptionID.Value == 0)
|
|
|
+ {
|
|
|
+ // 无选
|
|
|
+ EndDialogue1();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ // 玩家选择了选项,处理结果
|
|
|
+ SelectOption(selectedOptionID.Value);
|
|
|
+ }
|
|
|
}
|
|
|
//取消事件
|
|
|
else if (selectedOptionID.HasValue && selectedOptionID.Value == -1)
|
|
@@ -199,11 +212,12 @@ public class DialogueManager : Singleton<DialogueManager>
|
|
|
//不是一次性事件弹出boss界面
|
|
|
if (eventConfig.EventTriggerType != 2)
|
|
|
{
|
|
|
- bool relust = await BossInfoPanel.OpenPanel(dialogueConfig.optionPara1[0],CurrentEventList);
|
|
|
+ bool relust = await BossInfoPanel.OpenPanel(dialogueConfig.optionPara1[0], CurrentEventList);
|
|
|
if (relust)
|
|
|
{
|
|
|
CTask cTask = CTask.Create();
|
|
|
- CombatDrive.Instance.LoadLevelBattleCombat(dialogueConfig.optionPara1[0], true,CurrentEventList.heroLevel,
|
|
|
+ CombatDrive.Instance.LoadLevelBattleCombat(dialogueConfig.optionPara1[0], true,
|
|
|
+ CurrentEventList.heroLevel,
|
|
|
delegate(bool isWin)
|
|
|
{
|
|
|
LogTool.Log("战斗完成" + isWin);
|
|
@@ -222,7 +236,8 @@ public class DialogueManager : Singleton<DialogueManager>
|
|
|
else
|
|
|
{
|
|
|
CTask cTask = CTask.Create();
|
|
|
- CombatDrive.Instance.LoadLevelBattleCombat(dialogueConfig.optionPara1[0], false,CurrentEventList.heroLevel,
|
|
|
+ CombatDrive.Instance.LoadLevelBattleCombat(dialogueConfig.optionPara1[0], false,
|
|
|
+ CurrentEventList.heroLevel,
|
|
|
delegate(bool isWin)
|
|
|
{
|
|
|
LogTool.Log("战斗完成" + isWin);
|
|
@@ -260,7 +275,8 @@ public class DialogueManager : Singleton<DialogueManager>
|
|
|
case 4:
|
|
|
for (var i = 0; i < dialogueConfig.optionPara1.Length; i++)
|
|
|
{
|
|
|
- PlayerManager.Instance.BagController.DeductItem(dialogueConfig.optionPara1[i], dialogueConfig.optionPara2[i]);
|
|
|
+ PlayerManager.Instance.BagController.DeductItem(dialogueConfig.optionPara1[i],
|
|
|
+ dialogueConfig.optionPara2[i]);
|
|
|
}
|
|
|
|
|
|
break;
|
|
@@ -279,7 +295,8 @@ public class DialogueManager : Singleton<DialogueManager>
|
|
|
|
|
|
if (CurrentEventList != null)
|
|
|
{
|
|
|
- AccountFileInfo.EventLinkData eventLinkData = CurrentEventList.eventLinks.FirstOrDefault(el => el.eventLinkId == currentDialogueID);
|
|
|
+ AccountFileInfo.EventLinkData eventLinkData =
|
|
|
+ CurrentEventList.eventLinks.FirstOrDefault(el => el.eventLinkId == currentDialogueID);
|
|
|
|
|
|
if (eventLinkData != null)
|
|
|
{
|
|
@@ -334,7 +351,8 @@ public class DialogueManager : Singleton<DialogueManager>
|
|
|
// {
|
|
|
//
|
|
|
// }
|
|
|
- AccountFileInfo.EventList eventList = EventSystemManager.Instance.AddEvent(dialogueConfig.ResultOptions[0]);
|
|
|
+ AccountFileInfo.EventList eventList =
|
|
|
+ EventSystemManager.Instance.AddEvent(dialogueConfig.ResultOptions[0]);
|
|
|
if (eventList != null)
|
|
|
{
|
|
|
AccountFileInfo.Instance.playerData.eventList.Add(eventList);
|
|
@@ -369,7 +387,8 @@ public class DialogueManager : Singleton<DialogueManager>
|
|
|
EventConfig eventConfig = ConfigComponent.Instance.Get<EventConfig>(eventId);
|
|
|
if (eventConfig.EventTriggerType == 2)
|
|
|
{
|
|
|
- Vector3 worldPos = CombatDrive.Instance.CombatController.playerHeroEntity.combatHeroGameObject.hpTransform.position;
|
|
|
+ Vector3 worldPos = CombatDrive.Instance.CombatController.playerHeroEntity.combatHeroGameObject.hpTransform
|
|
|
+ .position;
|
|
|
|
|
|
worldPos.y += 0.5f;
|
|
|
await ShowItemNumberCom.Open(worldPos, rewardsDic[0]);
|