x


Device Auto-Rotation

Hi,

Is there any callback method in Unity to launch once the autorotation is triggered? I would like to insert some custom code to modify my GUI when the screen orientation is changed. Anyone have an idea of this trick please share with me.

more ▼

asked May 24 '12 at 04:01 AM

tr1stan gravatar image

tr1stan
36 3 5 9

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

we always use relative coordinate in gui, Screen、PlayerSettings、deviceOrientation class may help you ~ ~

more ▼

answered May 24 '12 at 05:40 AM

YUHUA gravatar image

YUHUA
0

Thanks for advice but I'm using absolute GUI layout. It's just too costly for me to convert the entire UI system to relative coordinate. I know how to use deviceOrientation class to rotate the screen. What I'm looking for is to find a way to start an action once the screen is transforming to a new orientation. Do you have an idea?

May 24 '12 at 05:52 AM tr1stan

you can check deviceOrientation every frame or analysis Input.GetAccelerationEvent if you want to contol it, you can use Screen.orientation -0-

May 25 '12 at 07:08 AM YUHUA
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2455
x1999
x1953
x481
x9

asked: May 24 '12 at 04:01 AM

Seen: 824 times

Last Updated: May 25 '12 at 07:08 AM