[SOLVED] Unity Button List

Issue

Hey everyone I am trying to create a Button List in the parent of the buttons but when I wrote;

 public List<Button> buttonList;

I get an error how can I fix that ? I want to loop through my buttons and give them listener but like I said I can’t write it this way and when I try to write it with GameObject instead of Button I can’t onClick and Listener to it.

Solution

Did you try to import UI library from Unity Engine. At the top of your script you should add:

using UnityEngine.UI;

Answered By – gguney

Answer Checked By – Pedro (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published.