Version: 2019.2
プロジェクトマニフェスト
埋め込まれた依存関係

依存関係

The dependencies attribute in the Project manifest is a JSON object that maps a package name to a version. The version number indicates which version of the package to download from the package registry. For example:

{
  "dependencies": {
    "com.my-package": "2.3.1",
    "com.my-other-package": "1.0.1-preview.1",
       etc.
  }
}

In addition to using version numbers, the Package Manager also supports adding Project dependencies with the following:

直接的な依存関係と間接的な依存関係

A direct dependency is a Project-level dependency. When you install a package through the Package Manager window, or manually edit the Project manifest.json file to explicitly add a dependency, you are creating a direct package dependency ():

Direct dependency (A): a package request from the Project manifest
Direct dependency (A): a package request from the Project manifest

Packages can declare their own dependencies to other packages. Such package dependencies become indirect (), or transitive, dependencies of your Project when you install the package.

間接的な依存関係 (B): 別のパッケージのマニフェストからのパッケージリクエスト
間接的な依存関係 (B): 別のパッケージのマニフェストからのパッケージリクエスト

The Package Manager determines which version of each package to install, no matter how it becomes a dependency of your Project. To do this, it prioritizes direct dependencies over indirect dependencies, as long as the higher priority version doesn’t violate any other requirements.

この評価は 依存関係の解決 と呼ばれ、おおよそ以下のロジックに従います。

  1. 直接的依存関係のバージョンを選択します。
  2. 直接的依存関係がなく、これが ビルトインパッケージ バージョンである場合は、 ビルトインのバージョンを選択します。
  3. 直接的依存関係がなく、これがビルトインバージョンでない場合は、これが複数のパッケージの間接的依存関係であるかどうかを確認します。
    • If this is an indirect dependency of only one package in the Project, there is no conflict, so select the higher of these versions:
      • この間接的な依存関係のバージョン
      • Unity に最低限必要なバージョン
    • 複数の間接的な依存関係が発生した場合、間接的依存関係が複数のバージョンをリクエストすると競合を作成することがあります。Package Manager は自動競合解決でほとんどの競合を解決できます。

In any case, you can manually override these resolution strategies. To do this, request a specific version in the Project manifest (either by installing from the Package Manager window or by editing the manifest directly). This creates a direct dependency, which takes precedence over any resolution strategy.

プロジェクトマニフェスト
埋め込まれた依存関係