fix: Round 56 亲密度门槛UI、空npcId警告、任务总览窗口、超时缓存、本地化Key检查、放弃任务交互、CurrentNpcId属性
- QuestManager.ApplyAffinity: giverNpc.npcId 为空时改为 LogWarning+return,不再静默丢弃好感度奖励 - QuestManager.UnlockBranches: 分支对话 npcId 为空时输出 LogWarning,提示开发者可能误推进对话类目标 - QuestGiver.InteractPrompt: Available 状态调用 GetQuestLockInfo,亲密度/前置未满足时显示锁定原因而非'接受任务' - QuestGiver.Interact_Internal: Available 状态加锁定检查防卫,锁定时提前返回;新增 _allowAbandon 字段(默认 false) - QuestGiver: Active+未完成+_allowAbandon=true 时显示'放弃任务'并触发 AbandonQuest,接入已有 AbandonQuest 接口 - DialogueManager: 新增 _waitSequenceTimeout 缓存字段,Awake 预创建避免每次 PlayImmediate 分配 WaitForSeconds - DialogueManager: 新增 _currentNpcId 字段,PlayImmediate 写入、EndDialogue/ForceEnd 清空 - IDialogueService + DialogueManager: 暴露 CurrentNpcId 只读属性,供外部系统主动查询当前对话 NPC - QuestSO.OnValidate: 对空 displayNameKey/descriptionKey 输出 LogWarning,防止 UI 显示空文本 - 新增 QuestOverviewEditorWindow: BaseGames/Quest/Quest Overview,列出全部 QuestSO,支持搜索/分类过滤; Play Mode 下读取 IQuestManager 运行时状态并着色显示;Edit Mode 高亮配置错误行;单击 Ping、双击 Select Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -395,7 +395,13 @@ namespace BaseGames.Quest
|
||||
"但 giverNpc 未配置,好感度无法发放。请在 QuestSO 中指定 giverNpc。", quest);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(quest.GiverNpcId)) return;
|
||||
if (string.IsNullOrEmpty(quest.GiverNpcId))
|
||||
{
|
||||
Debug.LogWarning(
|
||||
$"[QuestManager] 任务 '{quest.questId}' 的 giverNpc.npcId 为空字符串,好感度无法写入。" +
|
||||
"请在对应 NpcSO 中填写有效的 npcId 后重新保存 QuestSO。", quest.giverNpc);
|
||||
return;
|
||||
}
|
||||
|
||||
_npcRelations.TryGetValue(quest.GiverNpcId, out int current);
|
||||
int newTotal = current + quest.reward.affinityBonus;
|
||||
@@ -504,7 +510,13 @@ namespace BaseGames.Quest
|
||||
{
|
||||
if (dialogueService != null)
|
||||
{
|
||||
dialogueService.StartDialogue(branch.npcDialogueSequence, quest.GiverNpcId ?? "");
|
||||
string npcId = quest.GiverNpcId;
|
||||
if (string.IsNullOrEmpty(npcId))
|
||||
Debug.LogWarning(
|
||||
$"[QuestManager] 任务 '{questId}' 完成分支对话的 giverNpc.npcId 为空," +
|
||||
"EVT_NpcDialogueCompleted 将广播空 npcId,可能错误推进对话类目标进度。" +
|
||||
"请在 NpcSO 中填写有效的 npcId。");
|
||||
dialogueService.StartDialogue(branch.npcDialogueSequence, npcId ?? "");
|
||||
dialoguePlayed = true;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user