Esempio n. 1
0
    //SHOW DIALOGUE
    void ShowUI(DialogueUIOption option)
    {
        int index = 0;

        foreach (DialogueOption choice in option.line.responses)
        {
            DialogueButtonData button = createdButtons.Dequeue();
            button.buttonText.SetText(choice.line);

            button.unityButton.onClick.AddListener(option.onclickEvent[index]);
            button.button.SetActive(true);

            activeButtons.Add(button);
            index++;
        }
    }
Esempio n. 2
0
    void Awake()
    {
        if (buttonPrefab)
        {
            for (int i = 0; i < numButtons; i++)
            {
                GameObject button = GameObject.Instantiate(buttonPrefab, gameObject.transform);
                button.SetActive(false);

                DialogueButtonData data = new DialogueButtonData();
                data.button      = button;
                data.unityButton = button.GetComponent <Button>();
                data.buttonText  = button.GetComponentInChildren <TMPro.TextMeshProUGUI>();

                createdButtons.Enqueue(data);
            }
        }

        if (lineUI != null)
        {
            lineUI.enabled = false;
        }
    }