# IGP.UnitySDK.LyingBottle

IGP Unity SDK 的 Lying Bottle 可选模块。

本模块提供 Unity 游戏侧的 Lying Bottle 调用入口，并通过主包 `IGP.UnitySDK` 的 desktop session 完成请求。

## 安装

先安装主包：

```text
adapters/unity/Runtime/IGP.UnitySDK/package.json
```

再安装本模块：

```text
adapters/unity/Runtime/IGP.UnitySDK.LyingBottle/package.json
```

正式发布包对应：

```text
cn.indiegp.sdk.unity.lying-bottle-<version>.unitypackage
```

## 最小接入

```csharp
using IGP.UnitySDK;
using IGP.UnitySDK.LyingBottle;

public sealed class LyingBottleDriver
{
    private IGPRuntimeManager runtimeManager;

    public async void StartSubBottleSession(string subBottleId)
    {
        var result = await IGPLyingBottle.StartSessionAsync<object, object>(
            runtimeManager,
            subBottleId,
            new
            {
                clientOpenedAt = System.DateTimeOffset.UtcNow.ToString("O"),
            });
    }
}
```

也可以直接使用通用入口：

```csharp
var spec = IGPLyingBottleRoutes.Find(
    IGPLyingBottleHttpMethod.Get,
    IGPLyingBottleRoutes.Bottles);

var bottles = await IGPLyingBottle.CallAsync<object>(
    runtimeManager,
    spec);
```

## 当前范围

- 依赖主包 `cn.indiegp.sdk.unity`。
- 使用 desktop session 调用 Lying Bottle API。
- `appId` 配置在 `IGPConfig`，用于主包初始化。
- 带 `requestId` 的 POST body 中，业务 `requestId` 由游戏提供，重试同一个业务操作时必须复用。
- SDK 只校验 method、route、pathParams、query 的基础形状；body DTO 由 API 继续校验。

更多说明见：

- `Documentation~/QUICKSTART.md`
- `Documentation~/DEVELOPER-GUIDE.zh-CN.md`
