# Core Quickstart

```csharp
using IGP.UnitySDK;
using UnityEngine;

public sealed class IGPBootstrap : MonoBehaviour
{
    [SerializeField] private IGPRuntimeManager runtime;

    private async void Start()
    {
        runtime ??= FindObjectOfType<IGPRuntimeManager>();
        if (runtime == null || !await runtime.InitializeAsync())
        {
            Debug.LogError("IGP core initialization failed.");
        }
    }
}
```

There is no Host platform setting. During initialization Core checks the current
Unity runtime platform in Desktop-then-Mobile order, then constructs exactly one
matching runtime. Attach failure remains within that runtime and does not switch
platforms. Optional packages such as Multiplayer see only the active Core Host
capabilities and do not duplicate this policy.

The automatic platform choice does not change the game-facing API. Core routes
the same profile, capability, and Multiplayer calls through the active internal
Host Session transport.

The single initialization call establishes the active Host path first, then
awaits every `IIGPRuntimeExtension` on the same GameObject. A core-only
installation creates no game-data socket and has no network tick.

Explicit phone sign-in and source-neutral profile APIs are the exception to the
initialization requirement: they can use Core's allowlisted Direct Curio path
before `InitializeAsync()`. A Direct-signed-in user can also request an Arena
Session before Host initialization. Without Direct login, the same Arena API
uses the active initialized Host provider when its capability is available.
See [Account And Profiles](ACCOUNT-AND-PROFILES.md) and
[Arena Session](ARENA-SESSION.md). Other Core capabilities keep their documented
provider prerequisites; Core has no Gateway room-control prerequisite.

`RuntimeInfo` exposes host-provided values through named properties. `SaveRootPath` is always non-null and is empty when no save location is available; reading it does not create or modify the directory.

## Game Launch Content

Read the optional game launch string through the getter-only
`IGP.UnitySDK.Models.IGPRuntimeInfo.GameParams` property:

```csharp
var initialization = runtime.InitializeAsync();
string gameParams = runtime.RuntimeInfo.GameParams;
// Interpret the string according to your game's own format.
bool initialized = await initialization;
```

The Host may launch the game with `--game-params "level=forest;seed=42"` or
`--game-params="level=forest;seed=42"`. It must quote/escape the value so that
the operating system passes it as one argument. Use the equals form for values
starting with `--`.

The SDK captures the string synchronously at initialization entry before Host
I/O and extensions, including when attach later fails. It returns `""` before
capture, when omitted, or when supplied without a value. All supplied content,
including whitespace, Unicode and JSON text, is preserved verbatim; the SDK
does not parse or validate the game's format. If repeated, the last successfully
parsed value wins. The content is never written to SDK logs.

The value stays fixed through repeated initialization, reconnects, room changes
and shutdown. Reading it needs no Host connection and produces no event. This
parameter does not affect `GameMode` or require Multiplayer. The implemented
input carrier is the process command line; no Mobile Host message field is added.

## Launch Mode

`IGPRuntimeManager.GameMode` describes how this runtime was launched. It is
captured once at initialization entry, before Host I/O and optional extensions:

```csharp
var initialization = runtime.InitializeAsync();
IGPGameMode launchMode = runtime.GameMode;
// Multiplayer: show the multiplayer loading screen while initialization runs.
// Normal: use the ordinary startup screen.
// Unknown: startup intent is unavailable; do not infer single-player mode.
bool initialized = await initialization;
// Handle initialization failure separately from the selected launch mode.
```

The values are `Unknown = 0`, `Normal = 1`, and `Multiplayer = 2`. Before
initialization the value is Unknown. On Windows, Core uses the same complete
launch ticket, bootstrap endpoint and bootstrap secret as its Multiplayer
provider. No hosted launch options means Normal; incomplete options mean Unknown.
Mobile currently remains Unknown because no equivalent launch input is implemented.

Ticket consumption, initialization failure, disconnect, room exit, rematch and
shutdown never change the captured mode. An ordinary launch followed by an
in-game Lobby join or Host room notification remains Normal. No mode-change
event is emitted. Subscribe to the relevant room/connection events before
initialization to handle subsequent gameplay transitions; GameMode is not Ready.

## Achievements

```csharp
await IGPSDK.UnlockAchievementAsync(runtime, "FIRST_SESSION");
```

Multiplayer setup continues in `IGP.UnitySDK.Multiplayer/Documentation~/README.md`.
