Package Manager ウィンドウで作業するとき、複数のソース (レジストリ、ローカル フォルダー、.tgz ファイル、Git URL) からパッケージをインストールすることができます。しかし、Package Manager は、これらのソースからパッケージをシームレスにインストールします。ただし、Package Manager は、これらのソースからパッケージをシームレスにインストールしますが、最初に一連の計算を行って、どのバージョンをインストールするか、また、それをサポートするのにインストールが必要な他のパッケージやバージョンを決定する必要があります。
Package Manager ウィンドウでインストールするパッケージのバージョンを選択すると、 依存関係 を プロジェクトマニフェスト に加えることになります。これは、プロジェクトを動かすために、特定のパッケージの特定のバージョンが必要であるという宣言です。プロジェクトマニフェスト に示される依存関係は、“直接” 依存関係と呼ばれます。
パッケージは、機能するために他のパッケージを必要とすることがあります。これは “間接的” または “推移的” な依存関係と呼ばれます。パッケージの開発者は、開発中にこれらの依存関係を パッケージマニフェスト に加えます。例えば、以下の図では、alembic@1.0.7
パッケージは、timeline@1.0.0
パッケージに依存しています。つまり、timeline パッケージは “間接的” 依存関係にあります。一方で、プロジェクトは、cinemachine@2.6.0
と alembic@1.0.7
に依存しています。つまり、これらは両方とも “直接的” 依存関係です。
パッケージのバージョンを依存関係として加える場合、そのバージョンは Package Manager がインストールするバージョンとは限りません。なぜならば、プロジェクトにあるすべての依存関係を、直接か間接かにかかわらず考慮しなければならないからです。どのパッケージをインストールするかを決定するために、Package Manager はすべての直接および間接的な依存関係のリストを作成します。
Package Manager は、一度に 1 つのバージョンのパッケージしかインストールできません。そのため、各パッケージのどのバージョンをインストールするかを決定するために、依存関係グラフ を構築する必要があります。Package Manager は、すべてのバージョンの競合の解決に成功すると、その解決を ロックファイル に保存し、決定性を確保し (毎回同じパッケージが確実にインストールされます)、依存関係グラフの再計算にかかる時間とリソースを減らすことができます。
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.