Example #1
0
 //Calls necessary observer methods when the value gets flatly added to
 public void setValue(float val)
 {
     if (val == 0)
     {
         return;
     }
     if (val > 0)
     {
         OnIncrement.Invoke(val);
     }
     else if (val < 0)
     {
         OnDecrement.Invoke(val);
     }
     value = val;
     OnChange.Invoke(val);
     if (ValueAsBool())
     {
         OnTrue.Invoke();
     }
     else
     {
         OnFalse.Invoke();
     }
 }
Example #2
0
 public void Action(bool isOn)
 {
     if (isOn)
     {
         OnTrue?.Invoke();
     }
     else
     {
         OnFalse?.Invoke();
     }
 }
Example #3
0
    public void AnswerB()
    {
        if (currentQuestion != null && 1 == currentQuestion.GetAnswer())
        {
            print("correct");
            OnCorrect += currentQuestion.OnCorrect;

            DialogueSystem.DS.NextDialogue();
            OnCorrect?.Invoke();
            Destroy(boxA);
            Destroy(boxB);
        }
        else
        {
            print("false");
            OnFalse += currentQuestion.OnFalse;
            DialogueSystem.DS.NextDialogue();
            OnFalse?.Invoke();
            Destroy(boxA);
            Destroy(boxB);
        }
    }