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.
May 24 '12 at 04:01 AM
May 24 '12 at 03:02 AM
we always use relative coordinate in gui, Screen、PlayerSettings、deviceOrientation class may help you ~ ~
May 24 '12 at 05:40 AM
May 24 '12 at 05:32 AM
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?
you can check deviceOrientation every frame or analysis Input.GetAccelerationEvent if you want to contol it, you can use Screen.orientation -0-
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
Once you sign in you will be able to subscribe for any updates here
Answers and Comments
The best place to ask and answer questions about development with Unity. Check out our FAQ for more information.
To help users post good questions and use the site effectively we have posted a tutorial video. Please check it out.
asked: May 24 '12 at 04:01 AM
Seen: 824 times
Last Updated: May 25 '12 at 07:08 AM
How to have my mobile device screen lighting on all the time
iPhone Resolution Screen Switch
What is the update for iPhoneSettings.screenCanDarken
Simultaneous Android and iOS development
testing on an android device
Determine the game area of the iPhone display when status bar is shown
Lighting for a planet on mobile
Accelerometer - accounting for gravity for arbitrary device angle
Android Build has issues