Unity Quick Start
This page covers the minimum Core integration. After a match enters Playing,
Multiplayer synchronizes game data over RoomNode reliable and unreliable lanes.
Core checks the current Unity runtime platform in Desktop-then-Mobile order
and constructs exactly one matching runtime; attach failure does not switch
platforms, and users do not select one. Multiplayer has
no platform or initialization mode. Runtime can request a descriptor from Core
or accept one explicitly from its caller. RoomChanged and Runtime
room-lifecycle APIs are not Game data-plane integration points.
Prerequisites
Section titled “Prerequisites”cn.indiegp.sdk.unityis installed- Unity
2022.3 LTS - Windows 10 or newer
- An
appIdassigned by IGP operations - The matching IGP desktop client is installed and signed in when testing Desktop capabilities
1. Add a minimal initialization script
Section titled “1. Add a minimal initialization script”Create Assets/Scripts/IGPQuickstartDriver.cs:
using IGP.UnitySDK;using UnityEngine;
public sealed class IGPQuickstartDriver : MonoBehaviour{ [SerializeField] private IGPRuntimeManager runtime;
private async void Start() { runtime ??= FindObjectOfType<IGPRuntimeManager>(); if (runtime == null || !await runtime.InitializeAsync()) { Debug.LogError("IGP Core initialization failed."); return; }
Debug.Log($"IGP Core ready. Desktop attached={runtime.IsDesktopSessionAttached}"); }
[ContextMenu("IGP/Unlock Quickstart Achievement")] private async void UnlockAchievement() { var result = await IGPSDK.UnlockAchievementAsync(runtime, "first_session"); Debug.Log($"Unlock success={result.success}, duplicated={result.duplicated}"); }}2. Configure the scene
Section titled “2. Configure the scene”- Create a persistent scene object such as
IGPBootstrap. - Add
IGPRuntimeManagerandIGPQuickstartDriver. - Enter
appIdin the generatedIGPConfigasset. - Keep exactly one active
IGPRuntimeManager.
The component does not start the SDK automatically. Your startup flow must call
InitializeAsync() explicitly.
3. Validate
Section titled “3. Validate”Enter Play mode and confirm:
InitializeAsync()succeeds.IsDesktopSessionAttached == truewhen using Desktop capabilities.- Optional achievement calls return their expected result.
Core initialization does not mean a room or RoomNode data plane is connected. If
the active Host descriptor path is absent, Multiplayer logs a warning and keeps
IsRuntimeCreated == false. Validate Multiplayer with IsRuntimeCreated,
IsRealtimeReady, and Game message exchange, not RoomChanged.
Save root directory
Section titled “Save root directory”After InitializeAsync() completes, the game can read the save root for the
current game instance from runtime.RuntimeInfo.SaveRootPath and organize,
create, read, and write its own save files under that directory:
var saveRootPath = runtime.RuntimeInfo.SaveRootPath;The Host supplies this value. When no directory is available, the property is
an empty string and the game must decide whether to use another local storage
location. The SDK does not create, modify, clean up, or otherwise manage the
directory for the integrating project, and it does not normalize the returned
path. SaveRootPath is not a command-line argument; --game-params only carries
optional game launch content.