Example #1
0
    /// <summary>
    /// Sets the dialogue panel and hides it on start
    /// </summary>
    private void setDialoguePanel()
    {
        _DialoguePanel.gameObject.SetActive(true);
        _DialogueManager = _DialoguePanel.GetComponent <UIDialogueManager> ();

        Animator _DialogueAnimator = _DialoguePanel.GetComponent <Animator> ();

        _DialogueAnimator.Play("HideDialogue");
    }
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        UIDialogueManager d = FindObjectOfType <UIDialogueManager>();

        //Ensure d != null
        if (d == null)
        {
            Debug.Log("UIDialogueManager not found! Please make one.");
            return;
        }

        d.Display(dialogue, responses);
    }
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        UIDialogueManager d = FindObjectOfType <UIDialogueManager>();

        //Ensure d != null
        if (d == null)
        {
            Debug.Log("UIDialogueManager not found! Please make one.");
            return;
        }

        if (show)
        {
            d.Show();
        }
        else
        {
            d.Hide();
        }
    }