La confirmación llega cuando ya hay otra fila
La comparación de ID devuelve false y protege la nueva posición.
Casos prácticos
Espera la confirmación de un diálogo o la señal de animación externa del capítulo y avanza una sola vez.
Objetivo: avanzar solo cuando un sistema externo confirme que la conversación ha terminado. Mantén la API del proveedor en un puente del proyecto. Al recibir la notificación definitiva, exige un objetivo activo, compara el ID esperado y llama a TryCompleteObjective.
Variante: si el sistema expone un UnityEvent sin parámetros, enlázalo a Objective.CompleteFromEvent.
Activa Wait For External Animation. Inicia la animación desde el momento anterior y llama una vez a Chapter.SignalExternalAnimationCompleted() desde el último Animation Event. La señal libera las acciones de inicio; no completa la fila. El Chapter consume el indicador y detiene la espera si la fila se completa por otra vía.
La comparación de ID devuelve false y protege la nueva posición.
Puede liberar otra espera; emite desde la animación asociada a la fila actual.
Unifícalos en el puente y reenvía solo el resultado definitivo.
Usa ramas de MultiActionObjective; si son tareas consecutivas, crea filas separadas.
Los ejemplos compilados no dependen de ninguna marca de diálogo o animación.
using System;
using System.Collections;
using System.Collections.Generic;
using OverFuture.ChapterObjectiveSystem.Chapters;
using OverFuture.ChapterObjectiveSystem.Events;
using OverFuture.ChapterObjectiveSystem.Objectives;
using OverFuture.ChapterObjectiveSystem.Persistence;
using OverFuture.ChapterObjectiveSystem.Progression;
using UnityEngine;
public sealed class DialogueIntegrationExample : MonoBehaviour
{
public bool NotifyDialogueFinished(string expectedObjectiveId)
{
ChapterManager manager = ChapterManager.Instance;
Chapter chapter = manager != null ? manager.CurrentChapter : null;
return chapter != null && manager.HasActiveObjective &&
string.Equals(
manager.CurrentObjectiveId,
expectedObjectiveId,
StringComparison.Ordinal) &&
chapter.TryCompleteObjective(expectedObjectiveId);
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using OverFuture.ChapterObjectiveSystem.Chapters;
using OverFuture.ChapterObjectiveSystem.Events;
using OverFuture.ChapterObjectiveSystem.Objectives;
using OverFuture.ChapterObjectiveSystem.Persistence;
using OverFuture.ChapterObjectiveSystem.Progression;
using UnityEngine;
public sealed class ExternalAnimationGateExample : MonoBehaviour
{
public bool NotifyAnimationFinished()
{
ChapterManager manager = ChapterManager.Instance;
Chapter chapter = manager != null ? manager.CurrentChapter : null;
if (chapter == null || !manager.HasActiveObjective)
{
return false;
}
chapter.SignalExternalAnimationCompleted();
return true;
}
}