Пример #1
0
    public void CreateItemButton(Characters.CharsGenres genre, Sprite charsprite)
    {
        Transform     charTransform     = Instantiate(charTemplate, container);
        RectTransform charRectTransform = charTransform.GetComponent <RectTransform>();


        charRectTransform.Find("character").GetComponent <Image>().sprite = charsprite;

        container.gameObject.SetActive(true);


        charRectTransform.Find("character").GetComponent <Button>().onClick.AddListener(() => speech.Bubble());
        charRectTransform.Find("character").GetComponent <Button>().onClick.AddListener(() => speech.Generate());
    }