← Back to Cool GameX
Unity SDK · Free & MIT

CoolAPI 2.0 for Unity

Ship your game on Cool GameX. Achievements, stats, leaderboards, cloud saves and DLC — with a setup window, an offline queue and secure per-game sessions. No dependencies, Unity 2021.3+.

v2.0.0 · MIT licensed · Unity 2021.3+ · ~40 KB · no external dependencies

AchievementsUnlock, progress, events
StatsSet · add · get
LeaderboardsTop lists · around me
Cloud saves50 slots per player
DLC & ownershipDemo vs. full game
ReliableOffline queue · secure sessions

Setup in 3 steps

1Import

Assets → Import Package → Custom Package… and pick CoolGameX-SDK.unitypackage. The setup window opens by itself.

2Configure

Click Create settings, enter your game’s slug from the Creator dashboard and hit Test connection.

3Sign in

Use your Cool GameX account in the window. Play Mode now runs as you — test unlocks straight away.

That’s all. The SDK starts itself when your game launches — no Initialize() call and no scene object. When players start your game from the Cool GameX launcher, their session is picked up automatically.

Type-safe IDs New

Click Generate IDs in the setup window to get constants for every achievement and DLC — a typo becomes a compile error instead of a silently failed unlock:

using CoolGameX;

CoolGameXManager.Unlock(Ids.Achievements.SpeedRunner);
Your Editor sign-in is stored on your machine only (never in your project) and only as a short-lived test session for your game — your password is never saved. Reopen the window any time from Tools → Cool GameX → Setup.

Achievements

Unlocks are idempotent — call them as often as you like. The event fires only the first time.

CoolGameXManager.Unlock("first_blood");                 // fire-and-forget

UnlockResult r = await CoolAPI.Achievements.UnlockDetailed("first_blood");
if (r.NewlyUnlocked) PlayFanfare();                    // r.Queued = saved offline, syncs later

// incremental: saves progress, unlocks at the target
await CoolAPI.Achievements.Progress("kill_100", kills, 100);

AchievementInfo[] all = await CoolAPI.Achievements.GetAll();  // with unlock state
CoolAPI.Achievements.Unlocked += a => ShowBanner(a.name, a.points);

Stats

Per-player numbers that follow the player across machines. No setup — a stat exists the first time you set it.

CoolGameXManager.AddStat("enemies_killed");             // +1
int total = await CoolAPI.Stats.Add("enemies_killed", 5); // returns the new total
await CoolAPI.Stats.Set("deepest_floor", 12);
int kills = await CoolAPI.Stats.Get("enemies_killed");

Leaderboards New

A board is created the first time you submit to it. By default only a player’s best score is kept.

SubmitResult r = await CoolAPI.Leaderboards.Submit("high_score", 9001);
if (r.Improved) ShowNewBest(r.Rank);

// lower is better (speedruns)
await CoolAPI.Leaderboards.Submit("fastest_run", 83250, SortOrder.Ascending);

LeaderboardPage top  = await CoolAPI.Leaderboards.GetTop("high_score", 10);
LeaderboardPage mine = await CoolAPI.Leaderboards.GetAroundMe("high_score", range: 3);

Cloud saves New

Named slots per player, per game — up to 50 slots of 512 KB. Save any [Serializable] class.

[System.Serializable] class SaveData { public int level; public float health; }

await CoolAPI.CloudSave.Save("slot1", new SaveData { level = 7, health = 80 });
SaveData data = await CoolAPI.CloudSave.Load<SaveData>("slot1");
SaveSlot[] slots = await CoolAPI.CloudSave.List();

DLC & ownership

if (await CoolAPI.DLC.Owns(Ids.DLC.HauntedExpansion)) UnlockExpansion();

bool fullGame = await CoolAPI.Ownership.OwnsGame();   // demo vs. full content
PlayerProfile me = await CoolAPI.Player.GetProfile();    // "Welcome back, davi!"

Reliability & security

Manual control (optional)

Turn off Auto-start in the setup window and start the SDK yourself, or add the Cool GameX Manager component to your first scene. The 1.x API still works.

bool signedIn = await CoolAPI.InitializeAsync();

API reference

CoolAPI

MemberDescription
InitializeAsync()Configure, connect and sign in. Returns true when signed in.
IsConnected · IsAuthenticatedConnection and session state.
ConnectionChanged · SignedInEvents.
LaunchedFromLauncherTrue when started by Cool GameX.
LastError · LogLevel · StatusLine()Diagnostics.

Modules

ModuleMethods
AchievementsUnlock, UnlockDetailed, Progress, GetAll, IsUnlocked, Unlocked event
StatsSet, Add, Get, GetAll
LeaderboardsSubmit, GetTop, GetAroundMe
CloudSaveSave, Save<T>, Load, Load<T>, Delete, List
DLC · OwnershipOwns, ListOwned · OwnsGame
PlayerGetProfile, Name
QueuePendingCount, Flush, Changed event
CoolGameXManagerStatic Unlock, SetStat, AddStat, SubmitScore

What’s new in 2.0

Need a hand?

Stuck on setup? We’ll get you shipping.

Ask on Discord support@coolgamex.com