Game Development Reference
In-Depth Information
New UnityEvent system
Unity has always lacked a good and robust event system. Sure there are the
SendMessage and BroadcastMessage functions, but these are really slow and
can be expensive.
The new UnityEvent System is built around providing and handling all events with
a scene, primarily for the new UI system; but like everything else in Unity 4.x, it is
built to be extensible, and you can enhance your own components and scripts to
expose themselves automatically to the event system and derive new events when
things happen.
A note about UI events in the new Unity UI system: the interaction
events all rely on raycasting to detect clicks, touches, hovering,
and so on. It is very fast and efficient. However, if you build a
new UI component that cannot react to raycasting, then it won't be
recognized or respond to such interaction events.
Control extensibility
One very cool feature of the new UI system is that practically every component is
a script, meaning it can be used as the base for any new scripts you create. You can
either use them as is or even extend them further.
In Chapter 6 , Working with the UI Source , we will cover the coding behind all these
components including a walk through the open source library. I'll even throw in a
load of examples and reusable components from the community and myself.
Animation
A core tenant of the new UI system (since it is built upon the core of the new 2D
sprite system) was animation. Every single control or component of the new Unity
UI system is able to be fully animated.
Not only that, but it also gives different modes for how properties can be animated,
from static fixed values to dynamic values that will alter and update with the
controls behavior.
 
Search WWH ::




Custom Search