Android phone screen resolution of a variety of, resulting in poor grasp of development, fortunately, each engine on this screen resolution problem has a better way to handle; Unity3d also provides us with a good solution.
In Unity3d for Android game development, for different resolutions of the display effect is like the camera's automatic translation of the general, watched a lot of games, for the Unity3d development of Android game seemingly did not do the corresponding screen resolution processing, but with the camera's automatic movement, Make the scene bigger so that there is no blank background.
In fact, Unity3d development 3D game, for different resolutions, we only need to set 1 unique screen display area ratio (white is the aspect ratio), so that the display area will not be pulled along with the resolution of the change.
1 usingUnityengine;2 usingSystem.Collections;3 4 5 Public classResolution:monobehaviour {6 PublicCamera Maincamera;7 voidStart ()8 {9 //screen.setresolution ( A. A.TenMaincamera =Camera.maincamera; One //float screenaspect = 1280/720; Now the mainstream of Android phones to distinguish. A //maincamera.aspect---> Camera aspect ratio (width divided by height) -Maincamera.aspect =1.78f; - } the}
Unity3d Android Phone screen resolution problem