Unity - iOS Integration Guide
Last updated
Last updated
This doc introduce the integration steps for Unity games with export to iOS platform.
Unity (game engine)
Visual Studio (IDE)
C# (logic)
required: Xcode
Unity Version: 2019.3.6f1
Install Unity Modules In Unity Hub:
Download zip file and place everything into plugin/ios
folder in your unity project
Drop the CelerUnityBridge.cs
file anywhere in your workspace, that will be your briging file that communicates with Celer Game Sdk
In most cases, unity will embed every depedencies with your project, if not, go head and embed everything in the framework/plugin/ios
folder, but with one exception
Change Celersdk.framework
to Do not embed
(or Link
for older versions of xcode)
-- You can either setup your permissions in with your unilty plugin, or modify the iOS project exported by the Unity project
Unfornunately, you will have to disable bitcode if your are using Unity version 2019.3.6f1 or above. Since newer versions of unity have bitcode enabled by default.
Disable bitcode in the exported xcode project
InitializeDelegate()
Give a welcome scene in your game. Call launchCelerXUI API in welcome scene script while start game button be triggered.
SetDelegate(ICelerXMatchListener callback)
set listener to you game life cycle
LevelLoaded()
If game has been loaded and game rendering was finished, developers must call ready function to confirm game can be start, then CelerX will show a ready button in match view for player.
onMatchJoined(MatchInfo mathInfo)
This is when a match is generated for the game, use the random seed to generate your level and preload your game, when you game has been loaded, call CelerUnityBridge.LevelLoaded() to notify the sak
onMatchReadyToStart
This method will be called when "Ready" button has been clicked and CelerX has confirmed that everything is ready, It indicates that game can start now. Users will see your game scene here. Put your game start logics here.
submit()
When the game is over, call this API to submit final score to CelerX platform
For a pure OC project target before ios 12.2, please enable Always Embed Swift Standard Libraries
settings [https://stackoverflow.com/questions/55364816/with-swift-5-and-ios-12-2-should-i-change-always-embed-swift-standard-librarie]
Minimuim sdk requirement is iOS 11