Native mobile integration with Unity both for iOS and Android:
- Open the project in Unity.
- Select the StartScene as the root scene
- Check if project runs correctly. Note that it's not interactable in Unity editor.
- Exporting to Andorid:
File > Build Settings...
CheckExport project
checkbox when exporting to Android and select the root folder as/build/android
Open the project in Android studio and build it. - Exporting to iOS:
File > Build Settings...
Select the root folder as/build/ios
and name itapp
When prompted, select 'append'
Open the xcodeproj and build to device
-
The Android manifest gets overwritten each time a Unity export is initiated. According to the docs, the manifest is placed inside
Assets/Plugins/Android/
. When a new change is made to the manifest, the same must be copied back toAssets/Plugins/Android/
. I should add a graddle preBuild script to copy that automatically. -
Current commit contains irrelevant autogenerated code. I should further optimise gitignore-s
-
I should play around with interface orientations as the UnityPlayer is also listening for orientation changes...
-
Communication from iOS to Unity is currently through comma-separated string... JSON serialization is to be added if needed