- Home /
Question by
ConfusedExpert · Jan 15, 2015 at 12:09 PM ·
buttonbeginnerreferencemultiple
Buttons - Multiple Referencing
Hello,
I have a set of buttons that I intend to work with a character GameObject. Every button will call method from the character GameObjects. If I had to do it normally, i'd have to to reference the character for every button, then set the function. So if I have 10 buttons and 10 characters, i'd have to do it 100 times. Is there a way to shorten this process? Maybe something involving prefabs?
EDIT: Using the new 4.6 GUI
Comment
I'd recommend making a controller script which will keep the reference to all your characters. This controller script could send out the proper commands to a selected target and should receive the events from the GUI.
Your answer
![](https://koobas.hobune.stream/wayback/20220613180452im_/https://answers.unity.com/themes/thub/images/avi.jpg)