// Update is called once per frame


    public void StartDialog(Dialogstate[] ds, Dialogtransition[] dt)
    {
        dialogstates      = ds;
        dialogtransitions = dt;
        Time.timeScale    = 0f;
        currentState      = dialogstates[0];
        DisplayDialog();
    }
    public void ChoseOption(bool opA)
    {
        if (opA)
        {
            PlayerStatus.thePlayer.ChangeAnnoyance(currentState.oA_changeval);
        }
        else
        {
            PlayerStatus.thePlayer.ChangeAnnoyance(currentState.oB_changeval);
        }

        foreach (Dialogtransition t in dialogtransitions)
        {
            if (currentState.Equals(t.origial))
            {
                if (opA)
                {
                    if (t.oA_followup.callback != null)
                    {
                        t.oA_followup.callback();
                    }
                    if (t.oA_followup.end)
                    {
                        EndDialog();
                    }
                    else
                    {
                        currentState = t.oA_followup;
                    }
                    DisplayDialog();
                }
                else
                {
                    if (t.oB_followup.callback != null)
                    {
                        t.oB_followup.callback();
                    }
                    if (t.oB_followup.end)
                    {
                        EndDialog();
                    }
                    else
                    {
                        currentState = t.oB_followup;
                    }
                    DisplayDialog();
                }
                return;
            }
        }
    }