# manifest.jsonの編集

## レジストリサーバーの登録

RPGアツマールAPI for Unityは、今後Unityのパッケージマネージャによるパッケージ配信を行うようにしました。

その際に、パッケージを配信しているレジストリサーバーの場所をUnityに認識してもらうようにしなければいけないので、まずはその設定をします。

### manifest.jsonのファイルをテキストエディタで開く

<div align="left"><img src="/files/-MD8qd6duAshOeboOets" alt="Unityプロジェクトディレクトリ直下に「Packages」ディレクトリがあるのでそれを開く"></div>

<div align="left"><img src="/files/-MD8rPs9-WYxmDDihZoe" alt="「manifest.json」ファイルがあるので、テキストエディタで開きます。"></div>

### レジストリサーバーのURLを記述

manifest.json をテキストエディタ開いたら殆どの場合は以下の通りになっているはずです。

{% code title="manifest.json" %}

```
{
  "dependencies": {
    ~~~~ 中略 ~~~~
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
  }
}

```

{% endcode %}

この manifest.json に以下のデータを追記して下さい

```
  "scopedRegistries": [
    {
      "name": "SinoaUnityPackage",
      "url": "https://registry.npmjs.org/",
      "scopes": [
        "jp.sinoa"
      ]
    }
  ],
```

記述した結果以下の記述になっているはずです。

```
{
  "scopedRegistries": [
    {
      "name": "SinoaUnityPackage",
      "url": "https://registry.npmjs.org/",
      "scopes": [
        "jp.sinoa"
      ]
    }
  ],
  "dependencies": {
    ~~~~ 中略 ~~~~
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
  }
}

```

この状態の manifest.json を保存してUnityエディタに戻ると自動的に再ロードされます。

再ロードされたら、このページの次のページへ進んで下さい。

{% hint style="info" %}
もし SinoaUnityPackage のレジストリサーバー以外のサーバーがある場合は以下のように複数の記述をして下さい。
{% endhint %}

```
  "scopedRegistries": [
    {
      "name": "SinoaUnityPackage",
      "url": "https://registry.npmjs.org/",
      "scopes": [
        "jp.sinoa"
      ]
    },
    {
      "name": "OpenUPM",
      "url": "https://package.openupm.com",
      "scopes": [
        "...",
        "..."
      ]
    }
  ],
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sinoa-dev.gitbook.io/rpgatsumaruapiforunity/build-environment/install-library/edit-manifest-json.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
