I am a newbie to Unity with just some basic knowledge in programing.
Working currently on a school project, were I would need some help.
Well, I have several buttons in my scene - all for another purpose (“Add label” to GameObject, “Delete label” from GameObject and “View labels” of the GameObject).
If a button is clicked a panel will open with a text, inputfield and buttons in it.
I would like to use only one panel but depending on which button was clicked to open the panel, different content - meaning different text, inputfield and buttons shall be displayed.
You would have a few prefabs for the Text, InputField, and Buttons that you’d want to have on your panel, and then when the button is clicked, you make a copy of them and place them on (probably with some sort of GridLayoutGroup to automatically align them). Then you’d have to manually hook up each field or button to a method you want it to call, which is the part that would be annoying.
If you have less than 100 panels, I’d say there’s a pretty low chance of performance issues, unless you’re doing something wrong. You could probably even realistically have way more with no issue. You shouldn’t really worry about performance unless something’s obviously going to be a problem, what you’re suggesting seems like a minor improvement with next to no increase in performance.