- Home /
How to make a or array of GUI.Button's?
Trying to make a short list or array to store 4 different button's in. How can I do that?
Hey, you are creating a new question for each detail of the same issue, it'd be better for you to have it all in one place. Use comments to ask for more info, and give feedback on what you are given and what you don't understand. It 'll be just better for all of us.
O$$anonymous$$. I see that you're using the Legacy GUI. You actually can't store buttons with the legacy GUI. They only exist during OnGUI. Check my answer on your other question.
you should just use the new UI because the Legacy is really bad for performance if that is what you are ai$$anonymous$$g for
Answer by Baste · Dec 15, 2014 at 11:29 AM
The same way you make any other array.
Button[] myFourButtons = new Button[4];
And then you put the buttons in there. Tada!
He is actually using legacy GUI but you could not know that.
Ok so i'll switch to the new UI system. How can I store buttons in a list<> or array then? Cause when I type it in its as if its not a type.
Do you have using UnityEngine.UI at the top of your script? The UI is in a separate namespace.
Your answer
Follow this Question
Related Questions
How to repeat the same list of buttons? 1 Answer
How to select an Game Object from an Item List 0 Answers
images assigned to gameobjects by tag 2 Answers