Game Development Reference
In-Depth Information
All UI content when drawn to the scene through the Canvas renderer is
batched into quads for fast and easy rendering. This results in a simple
way to alter the makeup of these quads for effects before rendering
occurs, quickly and efficiently. This also means it will work for any
platform regardless of what type of graphic system it is.
Unity provides several of these effects out of the box in 4.6, one of which provides a
shadow effect on the UI GameObjects it's attached to. It gives the best effect on Text
components. It can only be used, however, on any GameObject that uses the Canvas
Renderer in the new UI system (for example, the new UI controls).
You don't have to stop there either; all effects are based on the
IVertexModifier interface, which allows you to create your
own effects as well. Just look at the source code for the UI system
for additional details on building these effects from the provided
implementations (see Chapter 6 , Working with the UI Source ).
To use these effects, simply add the required component (for example, Add
Component | UI | Effects | Shadow ) to the GameObject you want affected. The
Shadow component when added, looks like the following in the inspector window:
As you can see, the Shadow component gives you a couple of options to set
the color of the shadow (only color, not material) and how far out from the
GameObject the shadow should extrude. Here is what it looks like when the
Shadow effect is applied:
 
Search WWH ::




Custom Search