Quick start: Unity
Install the Unity package, initialise AOPClient, track gameplay and consume difficulty and mission adapters.
The Unity SDK (sdks/unity) is a UPM package with a runtime assembly, two example adapters and a bootstrap sample. It uses only UnityEngine and System. Status: source is complete but has not yet been compiled in a Unity Editor CI pipeline — treat it as beta.
Install
Unity → Package Manager → Add package from disk… → select sdks/unity/package.json.
Initialise and track
using System.Collections.Generic;
var aop = AOPClient.Init(new AOPSettings {
ProjectKey = "pk_…", // never ship sk_ keys
Endpoint = "https://api.your-domain.com",
});
aop.SetConsent(analytics: true, personalization: true, marketing: false);
aop.Identify("player_7c21"); // pseudonymous
aop.Track("level_started", new Dictionary<string, object> { ["level"] = 5 });
aop.TrackRevenue(4.99, "USD", new Dictionary<string, object> { ["sku"] = "gems_100" });
float speed = aop.GetParam("enemy_speed", 1.0f);
string missionJson = aop.GetExperience("daily_mission");Adapters
DifficultyAdapter consumes the adaptive_difficulty slot and clamps every multiplier to local developer bounds even if the server sends something else. MissionAdapter consumes daily_mission, tracks progress and raises OnRewardEarned — granting the reward stays your game’s responsibility.
Sessions follow OnApplicationPause/OnApplicationFocus; the offline queue is persisted to disk and sent with UnityWebRequest.