Frage

I am building a game in Unity3D for iOS and Android. For leaderboards and achievements, I want to use GREE in Android and Gamecenter in iOS. So, when building from Unity3D, is it possible to configure in such a way that GREE libs and files are not present in XCode project and iOS have no dependancy with GREE?

War es hilfreich?

Lösung

In the script, you can use the Platform Dependent Compilation to control which part of code get compiled and which part not. For example, you can write something like this:

static public void showLeaderBoard()
{
#if UNITY_IPHONE
   //Show GameCenter leader board
#elif UNITY_ANDROID
   //Show GREE's leader board 
#endif
}

Because you have just the same script for both iOS and Android, this script you write will be no issue for build. And for the purpose of preventing libs and files (I think they might all be plugin) show in wrong project folder, you can try to use the folders in your /Assets/Plugins/ folder. Put all iOS-only files to /Assets/Plugins/iOS/ and all Android-only files to /Assets/Plugins/Android/. After building for different platform, Unity will copy the files in corresponding folder to your iOS/Android project.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top