Exemple #1
0
 /// <summary>Starts a new dialogue if none is already in progress</summary>
 public void StartMonologue(Monologue monologue, Action onFinish = null)
 {
     if (!IsHoldingMonologue && !IsHoldingDialogue)
     {
         StartCoroutine(MonologueRoutine(monologue, onFinish));
     }
     else
     {
         monologueQueue.Enqueue(new CallbackMonologue(monologue, onFinish));
     }
 }
Exemple #2
0
        /// <summary>Returns an enumerator that waits for the dialogue to finish, resseting it when it has</summary>
        private IEnumerator MonologueRoutine(Monologue monologue, Action onFinish = null)
        {
            IsHoldingMonologue = true;
            backDrop.enabled   = true;

            monologue.SetupDisplay(display);

            yield return(SetupMonologue());

            yield return(monologue.Routine());

            monologue.Restore();
            onFinish?.Invoke();

            ResetDisplayPosition();
            CheckForDeque();
            OnMonologueEnd?.Invoke();
        }
Exemple #3
0
 public CallbackMonologue(Monologue monologue, Action callback)
 {
     this.monologue = monologue;
     this.callback  = callback;
 }