Unity UI: UI for arbitrary numbers of unknown objects

Channel:
Subscribers:
15,400
Published on ● Video Link: https://www.youtube.com/watch?v=cnVJH5elbPA



Duration: 17:36
829 views
17


ADVANCED level

Creating UI for an arbitrary number of unknown objects?

Step 1: Put all their UI prefabs into a vertical list.
Step 2: UI prefab has an instance of the object on it, allowing UI creators to wire it all up using UnityEvents and the inspector, no code.
Step 3: Use reflection to
A) copy the properties from the in-game object to the UI object
B) change the UI elements (drop down list, text box, etc) to the object's values using UnityEvents, so the UI creator can wire them up.
C) copy the properties from the UI object to the in-game object if anything changes.

Weak points: Lots of annoying boilerplate when creating new editable classes, since you need to throw a Unity Event whenever anything changes in order to properly set up the UI elements.

Not sure how clear I am, because I'm so far into my own game that I don't know how common this stuff is.







Tags:
+Unity