public void InvokeEvent(string id, params string[] args)
    {
        DialogEvent eventToInvoke = _events.Find(x => x.CheckAliases(id));

        if (eventToInvoke == null)
        {
            throw new System.ArgumentException($"DialogEvent named {id} not found in dispatcher {name}");
        }
        eventToInvoke?.Invoke(args);
    }
Example #2
0
 public void OnButton2Clicked()
 {
     if (!isTyping)
     {
         if (onButtonTwoClick != null)
         {
             onButtonTwoClick.Invoke(0);
         }
         else
         {
         }
     }
 }
Example #3
0
 public void OnButton1Clicked()
 {
     if (isTyping)
     {
         SkipToNextText();
     }
     else if (onButtonOneClick == null)
     {
         DialogSystem.GetInstance().NextDialog();
     }
     else
     {
         onButtonOneClick.Invoke(0);
     }
 }
    /// <summary>
    /// This method sets the current dialog node being used.
    /// It also calls the method <c>CheckIfBranching</c>
    /// </summary>
    /// <param name="basicDialog">The Dialog Node to be set as current.</param>
    public void SetDialogBox(BasicDialogNode basicDialog)
    {
        if (basicDialog == null)
        {
            TerminateDialog();
            return;
        }

        //Sets the _previous variable of the dialog given.
        if (HistoryQueue.Count != 0)
        {
            basicDialog._previous = HistoryQueue.Peek();
        }


        _currentBasicDialog = basicDialog;
        HistoryQueue.Push(basicDialog);
        onDialogBoxBegin.Invoke(basicDialog);

        CheckIfBranching(basicDialog._nexts);
    }
 private void OnClickOneButton()
 {
     onClickOneButton.Invoke(this);
     Close();
 }
 private void OnCloseComplete()
 {
     gameObject.SetActiveSafe(false);
     onClose.Invoke(this);
 }
 private void OnOpenComplete()
 {
     onOpen.Invoke(this);
 }