Unity uses a package manifest file (package.json
) to manage information about a specific version of a specific package. The package manifest is always at the root of the package and contains crucial information about the package, such as its registered name and version number. It also defines useful information to communicate to the user, such as a user-friendly name that appears in the UI, a brief description of the package, and the earliest version of Unity the package is compatible with.
The package manifest uses the JSON (JavaScript Object Notation) syntax to describe what the package contains. The file’s format is similar to npm’s package.json
format, but uses different semantics for some of its properties. Refer to the example for a sample package manifest file.
The Package Manager reads this manifest to find out what the package contains, how to unpack its contents, and what information to display the user in the Package Manager window. The manifest stores this information in a series of required, recommended, and optional properties.
これらのプロパティが存在しない場合は、公開するときにレジストリがパッケージを拒否するか、Package Manager がパッケージを見つけたりロードすることができません。
プロパティ | JSON 型 | 説明 |
---|---|---|
name | 文字列 | The officially registered package name. This name must conform to the Unity Package Manager naming convention, which uses reverse domain name notation. For more information about the naming convention, see Naming your package. Note: This is a unique identifier, not the user-friendly name that appears in the list view in the Package Manager window. |
version | 文字列 | パッケージのバージョン番号 (MAJOR.MINOR.PATCH)。 例えば、“3.2.1” は 3 番目のメジャーリリースの 2 番目のマイナーリリースで最初のパッチであることを示しています。 この値は セマンティックバージョニング に準拠する必要があります。詳しくは、バージョン管理を参照してください。 |
Package Manager は、推奨されるプロパティが有効な値を持っていなかったり、欠けている場合でも、プロジェクトにパッケージをインストールすることができます。
However, you should assign values for these properties to ensure that your package is discoverable and to provide a better experience for users.
プロパティ | JSON 型 | 説明 |
---|---|---|
description | 文字列 | A brief description of the package. This is the text that appears in the details view of the Package Manager window. This field supports UTF–8 character codes. This means that you can use special formatting character codes, such as line breaks (\n) and bullets (\u25AA). |
displayName | 文字列 | Unity エディター (例えば、Project ブラウザー、Package Manager ウィンドウなど) に表示されるユーザーに分かりやすい名前。 例えば、Unity Timeline、ProBuilder、In App Purchasing。 |
unity | 文字列 | パッケージが互換性を持つ最低の Unity バージョンを示します。これを設定しないと、そのパッケージはすべての Unity バージョンと互換性があるとみなされます。 書式は、 “<MAJOR>.<MINOR>” (例えば 2018.3)。特定のパッチを示すには、unityRelease プロパティを使用します。 ノート: Unity に互換性がないパッケージは、Package Manager ウィンドウに表示されません。 |
これらのプロパティは任意であり、省略することができます。ただし、設定する場合は、有効な値である必要があります。
プロパティ | JSON 型 | 説明 |
---|---|---|
author | オブジェクト | The author of the package. This object contains one required field, name, and two optional fields, email and url. For example: { "name" : "John Doe", "email" : "john.doe@example.com", "url" : "http://john.doe.example.com/" }
|
changelogUrl | 文字列 | URL で指定したパッケージの変更ログのカスタムの保存場所。以下はその例。"changelogUrl":"https://example.com/changelog.html" ノート: Package Manager が URL の場所に到達できない場合 (ネットワークの問題など) は、以下を行います。 - パッケージがインストールされている場合、ファイルブラウザーを開き、パッケージキャッシュ内の CHANGELOG.md ファイルを表示します。- パッケージがインストールされていない場合、Package Manager はオフラインの変更ログが利用できないという警告を表示します。 |
dependencies | オブジェクト | A map of package dependencies. Keys are package names, and values are specific versions. They indicate other packages that this package depends on. Note: The Package Manager doesn’t support range syntax, only SemVer versions. |
documentationUrl | 文字列 | URL で指定したパッケージのドキュメントのカスタムの保存場所。以下はその例。"documentationUrl": "https://example.com/" ノート: Package Manager が URL の場所に到達できない場合 (ネットワークの問題など) は、以下を行います。 - パッケージがインストールされている場合、ファイルブラウザーを開き、パッケージキャッシュ内の Documentation~ フォルダーを表示します。- パッケージがインストールされていない場合、Package Manager はオフラインドキュメントが利用できないという警告を表示します。 |
hideInEditor | ブーリアン | Package Manager hides most packages automatically (the implicit value is “true”), but you can set this property to “false” to make sure that your package and its assets are always visible. |
keywords | 文字列の配列 | Package Manager の検索 API によって使用されるキーワードの配列。これは、ユーザーが関連するパッケージを見つけるのに役立ちます。 |
license | 文字列 |
SPDX 識別子形式 を使用した OSS ライセンスの識別子、または “See LICENSE.md file” のような文字列。ノート: パッケージマニフェストでこのプロパティを省略すると、パッケージには LICENSE.md ファイルを加える必要があります。 |
licensesUrl | 文字列 | URL で指定したパッケージのライセンス情報の保存場所。以下はその例。"licensesUrl": "https://example.com/licensing.html" ノート: Package Manager が URL の場所に到達できない場合 (ネットワークの問題など) は、以下を行います。 - パッケージがインストールされている場合、ファイルブラウザーを開き、パッケージキャッシュ内の LICENSE.md ファイルを表示します。- パッケージがインストールされていない場合、Package Manager はオフラインライセンス情報が利用できないという警告を表示します。 |
samples | オブジェクトの配列 | パッケージに含まれるサンプルのリスト。各サンプルには、表示名、説明、Samples~ フォルダー自体から始まるサンプルフォルダーへのパスが含まれています。{ "displayName": "<name-to-appear-in-the-UI>", "description": "<brief-description>", "path": "Samples~/<sample-subfolder>" } 詳しい説明は、パッケージ用のサンプルの作成 を参照してください。 |
type | 文字列 | Package Manager に追加情報を与える定数。 内部使用のために予約されています。 |
unityRelease | 文字列 | パッケージに互換性のある特定の Unity のリリースを示す Unity バージョンの一部。このプロパティは、更新されたパッケージが Unity のアルファ/ベータの開発サイクルで行われた変更を必要とする場合に使用できます。例えば、新しく導入された API が必要な場合や、API アップデーター のルールなしに後方互換性のない方法で変更された既存の API を使用している場合などが該当します。 予想される形式は“<UPDATE><RELEASE>” (例えば 0b4)。 ノート: 推奨される unity プロパティを省略しても、特に影響はありません。 Unity に互換性がないパッケージは、Package Manager ウィンドウ に表示されません。 |
{
"name": "com.[company-name].[package-name]",
"version": "1.2.3",
"displayName": "Package Example",
"description": "This is an example package",
"unity": "2019.1",
"unityRelease": "0b5",
"documentationUrl": "https://example.com/",
"changelogUrl": "https://example.com/changelog.html",
"licensesUrl": "https://example.com/licensing.html",
"dependencies": {
"com.[company-name].some-package": "1.0.0",
"com.[company-name].other-package": "2.0.0"
},
"keywords": [
"keyword1",
"keyword2",
"keyword3"
],
"author": {
"name": "Unity",
"email": "unity@example.com",
"url": "https://www.unity3d.com"
}
}
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.