using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; using RPGCreationKit; using RPGCreationKit.Player; namespace RPGCreationKit { /// /// The player question in the Canvas, contains data about the Dialogue and the answer /// public class PlayerQuestionUI : MonoBehaviour { [HideInInspector] public PlayerQuestion question; [HideInInspector] public IDialoguable dialoguable; [HideInInspector] public IDialoguable[] dialoguables; [HideInInspector] public XNode.Node response; [HideInInspector] public bool DestroyAfter; public int position; public TextMeshProUGUI text; /// /// Init the gameobject by set up data and Listener for the Button /// public void Init(PlayerQuestion _question, IDialoguable _dialoguable, RPGCreationKit.DialogueSystem.DialogueNode _response, string _text, bool _destroyAfter, int _position, bool isNpcToNpcDialogue = false, IDialoguable[] _dialoguables = null) { question = _question; dialoguable = _dialoguable; dialoguables = _dialoguables; response = _response; text.text = _text; DestroyAfter = _destroyAfter; position = _position; if(!isNpcToNpcDialogue) gameObject.GetComponent