Beispiel #1
0
    void MakeNewResponse(string newDialog, int choiceValue)
    {
        ButtonObject newButtonObject = Instantiate(choicePrefab, choiceHolder.transform).GetComponent <ButtonObject>();

        newButtonObject.Setup(newDialog, choiceValue);
        Button responseButton = newButtonObject.gameObject.GetComponent <Button>();

        if (responseButton)
        {
            responseButton.onClick.AddListener(delegate { ChooseChoice(choiceValue); });
        }
    }