fix: Round 54 priority dequeue, onComplete callback, prerequisiteObjectiveId validation, localizationTable guard, FailQuest timestamp, remove empty ValidateBranchDialogueKeys
- DialogueManager.EndDialogue: dequeue by max-priority index instead of FIFO index-0 - DialogueManager.EndDialogue: fire _onCompleteCallback on normal end (was only in ForceEnd) - NpcSO.OnValidate: auto-restore localizationTable to 'UI' if cleared - QuestSO.ValidateObjectiveIds: validate prerequisiteObjectiveId references exist in same quest - QuestSO.OnValidate: remove call to empty ValidateBranchDialogueKeys stub + remove the stub itself - QuestManager.DispatchEvent toFail loop: write _completedAtUtc timestamp on quest failure Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -432,11 +432,19 @@ namespace BaseGames.Dialogue
|
||||
if (!string.IsNullOrEmpty(npcId))
|
||||
_onNpcDialogueCompleted?.Raise(npcId);
|
||||
|
||||
// 自动播放队首等待中的对话(脚本触发的连续序列)
|
||||
// 触发一次性完成回调(正常结束和强制中断均触发)
|
||||
var cb = _onCompleteCallback;
|
||||
_onCompleteCallback = null;
|
||||
cb?.Invoke();
|
||||
|
||||
// 自动播放优先级最高的等待中对话(保证高优先级对话不被低优先级插队)
|
||||
if (_pending.Count > 0)
|
||||
{
|
||||
var item = _pending[0];
|
||||
_pending.RemoveAt(0);
|
||||
int best = 0;
|
||||
for (int i = 1; i < _pending.Count; i++)
|
||||
if (_pending[i].priority > _pending[best].priority) best = i;
|
||||
var item = _pending[best];
|
||||
_pending.RemoveAt(best);
|
||||
PlayImmediate(item.seq, item.npcId, item.priority);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user