[RELEASED] AspectSwitcher - Easy adjustments to UI based on device aspect

One of the biggest issues when developing for mobile is device fragmentation. With so many different screen resolutions, orientations, and aspect ratios it can be a daunting task to accommodate all those devices. With AspectSwitcher, setting up your user interface or even adding different functionality based on the device’s active aspect ratio becomes quite simple.

This editor extension has been submitted to the Asset Store. I will update once the process has completed.

I’m happy to announce that AspectSwitcher has been released to the Asset Store: Unity Asset Store - The Best Assets for Game Making

We are very open to thoughts or specific suggestions on making this a better product. Please watch the video and let us know.

Hi pro, I just bought aspect switcher, so when I “Set all aspect components”, that throw error:
NullReferenceException: Object reference not set to an instance of an object
OneLoop.AspectSwitcherDevice.DoSetAllAspectComponents () (at Assets/OneLoop/Editor/AspectSwitcher/AspectSwitcherDevice.cs:34)

So how can I fix it, thanks !

each switcher script attached to the game object will be running it’s code in the update?

Hi Osntear,

It looks like there is a bug if you don’t have the Window > OneLoop > AspectSwitcher panel opened when you attempt a Set All Aspect Components. I will fix and upload to the store for approval. In the meantime, you can manually open the AspectSwitcher panel (and then close it if you want) to initialize the Editor parts of the system and then everything should all work.

Cheers,
Jason

Hi MoHoe,

No, each AspectDeviceHandler applies the appropriate properties on Awake. I’m currently investigating auto detection of orientation switching to add to AspectSwitcher.

Cheers,
Jason

Thanks for your support :slight_smile: I got it. Thanks you so much :slight_smile:

I’ve submitted the fix to the asset store yesterday so hopefully that should be up in the next couple of days. After that version goes out, I’ll update AspectSwitcher to include a new AspectSwitcherAutoOrientation component that will monitor the screen aspect and update the AspectDeviceHandlers whenever the device’s aspect changes.

1 Like

Also please rate the extension when you are able to. If there is some feature that is lacking, just let me know. Thanks!

1 Like

Version 1.02 is now available in the Asset Store. It contains the fix Set All Aspect Components. Will be submitting version with AspectSwitcherAutoOrientation this week.

1 Like

Hi Jason.King,
I’m a newbie, so I really thanks for your asset, that’s working perfect for me :slight_smile:
Could I have a question about FPS in unity2D ?
So I used Unity Free for build game to IOS, and in Unity Editor FPS our game is 210 FPS, but when I build it to IOS that so delay ( lag ), I can see that slower than Unity Editor. Why ? I guess, 'cause I used Unity Free. So could you please tell me something in this case. Thanks u so much :slight_smile:

I would suspect that your PC/MAC that you are using with the Editor is simply quite a bit faster that your iOS device. It should not be a Free vs Pro issue.

Version 1.03 is now available in the Asset Store. It contains the new AspectSwitcherAutoOrientation component. Additionally it is now designated as being compatible with Unity 4.3.0 or higher.

Hi there jason, would your AspectSwitcher fix this issue for me? I need 1080p portrait to not compress the game. Thanks!
Rob

Yes, you would first add an AspectCamera component to your camera. Then you can specify appropriate camera values per defined aspect ratio - it does not automate the task of calculating the appropriate camera values. But once you have done this then it will automatically assume those new values depending upon the closest aspect that has been defined.

Hi i want to ask you if this work with PC also with different aspect ratio and resolution and if i have gui.button it will be in the same position on different aspect ratio

Hi Tareqz,

The system works with any device type including the PC. The main default component with the AspectSwitcher system will move elements that have Transform components. Standard gui.button is a runtime object (presented to the player during the OnGui) that doesn’t have a Transform component so AspectSwitcher does not work with such objects.

Cheers,
Jason

I’m interested in your asset. I have several menus which utilize scrollrects with content size fitter component, layout group component, etc. for scrolling/infinite menus.

Does you aspect work well with these components? The problem I’m seeing is my app looks great in iPhone 5, 6 and 6plus, but on the iPad it looks terrible.

Thanks

Hi Blamejane,

I believe that it will work. Essentially its an automating system that allow you to change transforms and such of you objects at runtime based on the closest aspect ratio of the device that you are using. If the problem is that you can make it look good for either device aspect A or device aspect B (by moving and adjust the dimensions of your objects), but not both at the same time. Then AspectSwitcher will help make the process of setting up and switching between the various dimensions much easier. We used it for setting up different portrait aspects (phone vs pad) as well as setting up a completely different set of dimensions for landscape. The systems comes with basic transforms and camera handlers. If you need to adjust other internal components based on the aspect then you can create your own handlers for specific features.

Cheers,
Jason