private void CreateAnswerButton(DialogueAnswer answer, Action <DialogueTree> answerChosen) { AnswerButton button = Instantiate(buttonPrefab); button.SetAnswer(answer); button.OnAnswerChosen += (caller, args) => { answerChosen.Invoke(args.nextTree); RemoveAnswers(); answerContent.gameObject.SetActive(false); }; button.transform.SetParent(answerContent); button.transform.localScale = Vector3.one; }
private void SetupAnswerButton(AnswerButton button, int index) { button.SetAnswer(answers[index], delegate { AnswerQuestion(button, index); }); }