Game Development Reference
In-Depth Information
Through this simple interface, we can attach the Click event from the UnityEvent
System to just about anything else within the realm of the Unity Editor; this includes:
• Script methods (not statics)
• GameObject properties
• GameObject components
We'll cover more on what you can and can't use as parameters to
script methods in Chapter 6 , Working with the UI Source ; for now just
know you can only use base .NET types such as string, float, int, and
bool or Unity types as parameter values.
Once you click on the + symbol, it adds an action to the list; every item in the list is
then called or executed when the event occurs. Each action in the list looks like
the following:
Looking closer at this action item in the list, we see the following:
1.
Runtime selector : A simple little option with each event is that you can
decide if you want it to also run in the editor or just in the game. As always,
there is also the option to just turn off an Event rather than delete it and lose
the setting.
The runtime selector when you select an editor option is effectively the
same as using the [ExecuteInEditMode] attribute in scripts.
2.
Object selector : Clicking on the Object selector brings up the standard object
browse window, which allows you choose from items in the current scene
or from the entire project (including the built-in Unity assets). Selecting an
object will then enable the Action selector .
 
Search WWH ::




Custom Search