ui hacks in unity3d_babbq2013

14
UI Hacks in Unity3d Kimberly Unger

Upload: kimberly-unger

Post on 28-Jun-2015

98 views

Category:

Entertainment & Humor


1 download

DESCRIPTION

Slide presentation given at the Big Android BBQ 2013 on various artist friendly ways to work around UI limitations in Unity3d.

TRANSCRIPT

Page 1: UI Hacks in Unity3d_BAbbq2013

UI Hacks in Unity3dKimberly Unger

Page 2: UI Hacks in Unity3d_BAbbq2013

Unity 3d

Page 3: UI Hacks in Unity3d_BAbbq2013

Reactive Design

Adjusts automaticallybased on the screen ratio,

resolution and orientation.

Page 4: UI Hacks in Unity3d_BAbbq2013

Resolution Independence

The built in UI methodis resolution dependent.

Page 5: UI Hacks in Unity3d_BAbbq2013

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.

Page 6: UI Hacks in Unity3d_BAbbq2013

3d Interface Elements

Fully animated UI elements

Page 7: UI Hacks in Unity3d_BAbbq2013

3d Interface Elements

Fully animated UI elements

Page 8: UI Hacks in Unity3d_BAbbq2013

3d Interface Elements

Fully animated UI elements

Page 9: UI Hacks in Unity3d_BAbbq2013

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);}

Page 10: UI Hacks in Unity3d_BAbbq2013

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);}

Page 11: UI Hacks in Unity3d_BAbbq2013

Relative Coordinates

Active adjustment and placement of banner ads based on device type and resolution.

Page 12: UI Hacks in Unity3d_BAbbq2013

Text Meshesvoid FormatTimer () {

if(sec < 10) {

strSec = "0" + sec.ToString();timerText.text = strSec.ToString();

}

Converting text to 3d text meshes allows forresolution independence.

Page 13: UI Hacks in Unity3d_BAbbq2013

Pseudo-dynamic Text

Large quantities of text or

repeated use of text fields might do better with a

custom font.

Page 14: UI Hacks in Unity3d_BAbbq2013

Kimberly UngerBushi-go, [email protected]