- Home /
How do you develop games for multi-platforms in 1 single project
When you develop for multi-platforms for Android and iOS, you can use something like
if (Application.platform == RuntimePlatform.IPhonePlayer)
But what about distinguishing iPhone4, iPAD, iPAD mini, Iphone5? My game has different UI sizes for these platforms.
don't forget about using #if in the preprocessor
http://docs.unity3d.com/Documentation/$$anonymous$$anual/PlatformDependentCompilation.html
regarding UI many people use one of the various "gui" packages because it's just such a nuisance doing different sizes
if you use 2DToolkit, it now automatically makes sprite sheets for different platform sizes
unfortunately there is no solution (fundamentally) other than just to program it, ultimately using "screen.width" and so on. again in general many people use one package or another to do UI and similar problems, for just this reason
eg http://answers.unity3d.com/questions/384623/setting-font-size-according-to-screen-dpi.html
Thanks Fattie. But I wonder how to distinguish iPhone4 iPhone5 iPad IPAD $$anonymous$$INI in Unity3d, since they all belongs to RuntimePlatform.IPhonePlayer.
Answer by Fattie · Mar 30, 2013 at 01:28 PM
OK I think I know what you're asking now.
if ( iPhone.generation == iPhoneGeneration.iPad1Gen )
and all the similar commands, see doco page
also I use Screen.width very often to check exactly what device it is. Cheers!
Your answer
![](https://koobas.hobune.stream/wayback/20220613095342im_/https://answers.unity.com/themes/thub/images/avi.jpg)