Uinity - ios\android

Hi

I am using unity to develop a game.
i want to create an ios and an android version from it.
what is the best approach for developing cross platform with uninty ?
i need to mainatin a different configuration for each platform.
i want to have one project that i can create a build to ios or android easly.
thanks in advance

Android in general is a bit more tolerant to different configurations, than iOS. First off - if you wanna develop for iOS, work on a mac - developing on a PC and then porting to iOS by copying your project to a mac will almost certainly give you some headaches. Develop for iOS, then and constantly save two versions, one for iOS, one for android and make builds every now and then for both platforms, to make sure, it works on both.

really ? can’t i have one project without splitting it ?

I’ve only finished one game, which was iOS only, so take my input for what it’s worth.

I’d imagine a well-formed multi-platform mobile project would be able to share 95% of its resources across Android and iOS. For libraries that are platform-specific (like Game Center for iOS), they should be included and referenced using platform-dependent compiler flags. If you need to check at runtime, you can do a platform check another way, but I’d recommend using the first method wherever possible.

2 Likes

At work (Synapse Games) we have just one project for each game (Tyrant Unleashed, Global Assault, etc) and deploy them to both iOS and Android. There are two main things to keep in mind:

One is the platform compiler directives schneider linked to. You can drop those directives in the code anywhere the game differs on different platforms (eg. Game Center vs. Google Play Games).

The other thing to bear in mind is that Unity takes a long time to switch platforms; big games like ours can take half an hour. That’s because Unity is recompressing all assets to optimize for that platform. Don’t be surprised if you need to wait.