public void Initialize(IDialogueUIController controller) { _controller = controller; int index = 0; foreach (var answer in GetComponentsInChildren <UIElementAnswer>()) { var customAnswer = answer as ICustomAnswer; if (customAnswer != null) { answer.Init(_controller); _customAnswers.Add(customAnswer.ID, answer); } else { answer.Init(_controller); BindKeyToAnswer(index, answer); _answers.Add(answer); index++; } } // TESTING string message = ""; if (Test(out message)) { Debug.LogError(message); return; } }
public override void Init(IDialogueUIController controller) { var button = GetComponentInChildren <Button>(); button.onClick.AddListener(Select); button.onClick.AddListener(UpdateVariable); uiController = controller; }
public virtual void Init(IDialogueUIController controller) { _button = GetComponent <Button>(); if (_button != null) { _button.onClick.AddListener(Select); } uiController = controller; }
public override void Init(IDialogueUIController controller) { base.Init(controller); _iconLibrary = GetComponentInParent <IconLibrary>(); }