ui hacks in unity3d_babbq2013
DESCRIPTION
Slide presentation given at the Big Android BBQ 2013 on various artist friendly ways to work around UI limitations in Unity3d.TRANSCRIPT
UI Hacks in Unity3dKimberly Unger
Unity 3d
Reactive Design
Adjusts automaticallybased on the screen ratio,
resolution and orientation.
Resolution Independence
The built in UI methodis resolution dependent.
3d Interface ElementsRendering is dependenton the asset resolution,
rather than on the screen resolution.
Single set of assets for all devices.
Animations can be built into the mesh.
3d Interface Elements
Fully animated UI elements
3d Interface Elements
Fully animated UI elements
3d Interface Elements
Fully animated UI elements
Make it a button!if (Input.GetMouseButtonUp(0))
{RaycastHit rc_hit;
Ray hud_ray = Camera.main.ScreenPointToRay(Input.mousePosition);if(Physics.Raycast(hud_ray, out rc_hit, Mathf.Infinity, 1<<LayerMask.NameToLayer("TouchPad")) )
{
if (rc_hit.transform.gameObject == R01_C01) { BlockR01_C01.audio.Play();
BlockR01_C01.transform.Rotate(0,0,90);}
Make it a button!if (Input.GetMouseButtonUp(0))
{RaycastHit rc_hit;
Ray hud_ray = Camera.main.ScreenPointToRay(Input.mousePosition);if(Physics.Raycast(hud_ray, out rc_hit, Mathf.Infinity, 1<<LayerMask.NameToLayer("TouchPad")) )
{
if (rc_hit.transform.gameObject == R01_C01) { BlockR01_C01.audio.Play();
BlockR01_C01.transform.Rotate(0,0,90);}
Relative Coordinates
Active adjustment and placement of banner ads based on device type and resolution.
Text Meshesvoid FormatTimer () {
if(sec < 10) {
strSec = "0" + sec.ToString();timerText.text = strSec.ToString();
}
Converting text to 3d text meshes allows forresolution independence.
Pseudo-dynamic Text
Large quantities of text or
repeated use of text fields might do better with a
custom font.
Kimberly UngerBushi-go, [email protected]