Help with PostprocessBuildPlayer script

I’ve been trying to figure out how to create a script that changes UISupportedOrientation in info.plist to only allow LandscapeLeft/Right without luck. I’ve read through the unitycommunity script but it only shows how to add a key, where as I need to delete two entries (Portrait and upsidedown).

I’ve also searched Unity forums/answers without finding anything, so hopefully this information isn’t buried somewhere.

Thanks very much! :wink:

For the person who provides the answer I’ll send them a promocode when my first iPhone game Laundry Rush is released… It’s being submitted to Apple this weekend :slight_smile:

I use a script in each level that does this, every 1 sec or so, I simply check to see what oriantaion the device is and if the screen does not match it, then change the screen orientation to match that. In the player settings set to landscape left (or right) only, then add the script on every level. This works on the iphone and iPad to only allow landscape and to rotate the screen. I can post my code tomorrow morning if you want it.

Crazy Robot: Thanks, I also do this but I’ve found that removing the UISupportedOrientation prevents it from ever starting up as Portrait… No matter how much I’ve tried to disable the portrait rotations it always boots in portrait (even when setting the Unity Player settings to landscape).

Hmmmm, I do not have that issue at all, are you sure there is not a script somewhere in your scenes that refer to portrait (maybe a 3rd party script)? I would bring up finder then navigate to my assets folder (you will need to change the search to current folder:

To change it, go to Finder → Preferences and then to the “Advanced” tab. Then, on the drop-down menu for “When performing a search:” select “Search the Current Folder”

Then do a search for “Portrait”, it will find all scripts in your project that has that word in it.

Now I feel silly… It was EZGUI :stuck_out_tongue: Huge thanks for that Crazy Robot! Will send you a promo code :wink:

I’m happy I could help, I look forward to playing your game!!!

JL