コード例 #1
0
    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;
    }
コード例 #2
0
 private void SetupAnswerButton(AnswerButton button, int index)
 {
     button.SetAnswer(answers[index], delegate { AnswerQuestion(button, index); });
 }