When Unity loads a Project, the Unity Package Manager reads the Project manifest so that it can compute a list of which packages to load. When a user installs or uninstalls a package through the Package Manager window, the Package Manager stores those changes in the Project manifest file. The Project manifest file manages the list of packages through the dependencies object.
In addition, the Project manifest serves as a configuration file for the Package Manager. It stores the location of one or more package registries. For Git packages, it also provides a lock object defining a commit hash and revision number to guarantee that the Package Manager always installs exactly the same dependencies.
You can find the Project manifest file, called manifest.json
, in the Packages
folder under the root folder of your Unity Project. Like the package manifest file, the Project manifest file uses JSON (JavaScript Object Notation) syntax.
All attributes are optional. However, if your Project manifest file does not contain any values, the Package Manager window doesn’t load, and the Package Manager doesn’t load any packages.
Tip: At any time, you can fix any problems with your registry by choosing Reset packages to defaults from the main Unity Help menu. However, be aware that this action resets all changes you made to the packages in your Project so it is best to use this strategy as a last resort.
キー | JSON 型 | 説明 |
---|---|---|
dependencies | オブジェクト | プロジェクトで利用可能なパッケージのリスト。マニフェストのこのエントリは、マップ構造を使用して、プロジェクトに必要なバージョンに関連付けられたパッケージ名を列挙します。 サポートされているすべてのスキームの詳細な概要については、依存関係のセクションを参照してください。 ノート: このリストには、間接的な依存関係 (他のパッケージが必要とするパッケージ) は含まれていません。 |
registry | 文字列 | Unity Package Manager のメインレジストリの URL。これにより、デフォルトのレジストリ URL (https://packages.unity.com ) がオーバーライドされます。ノート: デフォルトのレジストリを独自のレジストリでオーバーライドすると、公式の Unity のパッケージにアクセスできなくなります。代わりに、独自のパッケージのプライベートコレクションを Unity パッケージライブラリに加えて拡張したい場合は、scopedRegistries 属性を設定してスコープ付きレジストリを使用します 。 |
scopedRegistries | オブジェクトの配列 | デフォルトのレジストリに加えて、カスタムのレジストリを指定します。これにより、独自のパッケージをホストすることができます。 詳細はスコープ付きレジストリを参照してください。 |
lock | オブジェクト | コミットハッシュと選択したリビジョンを持つ Git パッケージを示します。Package Manager はこの属性を自動的に更新します。これにより、Package Manager がまったく同じ依存関係をインストールすることを保証します。 この属性は Git パッケージ用に予約されていますが、将来、他の機能が決定論的なパッケージバージョン解決を保証するために使用する可能性があります。 |
testables | 文字列の配列 | Unity Test Runner に加えたいパッケージ名を列挙します 。詳細は、パッケージにテストを追加を参照してください。 |
{
"registry": "https://my.registry.com",
"scopedRegistries": [{
"name": "My internal registry",
"url": "https://my.internal.registry.com",
"scopes": [
"com.company"
]
}],
"dependencies": {
"com.unity.package-1": "1.0.0",
"com.unity.package-2": "2.0.0",
"com.unity.package-3": "3.0.0",
"com.unity.my-local-package": "file:/path/to/com.unity.my-local-package",
"com.unity.my-git-package": "https://my.repository/my-package.git#v1.2.3"
},
"lock": {
"com.unity.my-git-package": {
"hash": "9e72f9d5a6a3dadc38d813d8399e1b0e86781a49",
"revision": "v1.2.3"
}
},
"testables": [ "com.unity.package-1", "com.unity.package-2" ]
}
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.