UV and animation note
By default, textured quads are generated with UV mapping to show a complete texture, from the top-left corner to the
bottom-right corner. This does not meet the needs of Atlas Textures. To fix this, we’ll need to edit the mesh UV mapping.
Note The Unity GUI and EditorGUI framework is not object-oriented in the traditional sense; rather, it’s a
declarative framework. This means that to create widgets in the interface, such as text boxes and labels, you
do not instantiate any text box or label or widget objects. You simply call a function in the OnGUI event, such
as GUILayout.Label and GUILayout.Button (see Listing 7-2) to render the appropriate widget, and
Unity handles the rest automatically. More information on this framework can be found here:
http://docs.unity3d.com/Documentation/Components/GUIScriptingGuide.html.
It must be noted here that OnGUI is typically called several times per frame (not per second). This therefore
makes OnGUI a very expensive function in computational terms. This might not be so much of an issue when
creating Editor GUIs on power development systems, but it could easily become a crippling burden for games,
especially games on mobile devices. Indeed, many developers avoid the Unity GUI framework altogether and
just ”roll their own”, or they use Asset store add-ins, such as EZGUI or NGUI (although these add-ons are for
making in-game GUIs and not Editor GUIs).

浙公网安备 33010602011771号