Skip to content

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.

  • cn.indiegp.sdk.unity is installed
  • Unity 2022.3 LTS
  • Windows 10 or newer
  • An appId assigned by IGP operations
  • The matching IGP desktop client is installed and signed in when testing Desktop capabilities

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}");
}
}
  1. Create a persistent scene object such as IGPBootstrap.
  2. Add IGPRuntimeManager and IGPQuickstartDriver.
  3. Enter appId in the generated IGPConfig asset.
  4. Keep exactly one active IGPRuntimeManager.

The component does not start the SDK automatically. Your startup flow must call InitializeAsync() explicitly.

Enter Play mode and confirm:

  1. InitializeAsync() succeeds.
  2. IsDesktopSessionAttached == true when using Desktop capabilities.
  3. 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.

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.