The Kongregate Mobile SDK supports a subset of functionality for Unity games targetted at the web and uploaded to Kongregate. The main purpose of this is to allow Kongregate Plus beta games to track user behavior and generate analytics before publishing your mobile game to test markets.
The first thing you should do is integrate follow the instructions for integrating the Kongregate Mobile SDK into your Unity project.
In general, all of the methods in the
Analytics class are supported, along with some of the methods on the
Services class. You can also use the
Stats method for submitting statistics, and the
Mtx class for checking the user’s Kongregate inventory. Kongregate events such as
READY will also be fired as normal. All of the methods on the
Mobile class are stubbed out.
You should experiment with the Unity API while your game is still in the preview state. Your producer will set up the various analytics properties for your game and let you know when everything is ready to go.
You do not have to manage Keen/Swrve keys in the client for web builds. While your game is in preview mode, analytics will be sent to a sandbox, and once in beta/production data will automatically be sent to the live projects.
The analytics mode for web games is also handled on the server side. Your producer will set this up properly for you so you do not need to worry about it.
Using the WebGL target works using the same interface as the WebPlayer target. However, one additional step is required to load the Kongregate API. The following line must be included under the
head tag of the generated
index.html file prior to uploading to Kongregate.
To save yourself from having to add this line everytime you build, it’s a good idea to configure a Custom WebGL Template which can always include it.
In order to enable the web API in your Unity game
KongregateAPI.Settings.WebEnabled must be set to
READY event when initialization is complete.
Your existing analytics calls such as
KongregateGameObject.cs has been updated with examples of how this can be accomplished:
READY event has fired.