Package Manager は、 リモートサーバーの Git リポジトリからパッケージを読み込めます。
For more information about using Git URLs with the Unity Package Manager, see the documentation on using Git URLs in your Project manifest.
Git URL からパッケージを読み込むには、以下の手順を行います。
ステータスバーの Add ボタンをクリックします。
パッケージを加えるためのオプションが表示されます。
ドロップダウンから Add package from git URL を選択します。テキストフィールドと Add ボタンが表示されます。
テキストフィールドに有効な Git URL を入力し、Add をクリックします。
Unity がサポートするプロトコルの詳細は、Git URL を参照してください。
パッケージが正常にインストールされると、パッケージリストに git タグとともに表示されます。
Unity がパッケージをインストールできなかった場合、Unity コンソールはエラーメッセージを表示します。詳細は、後述のエラーメッセージを参照してください。
存在しない場所を指定すると、Unity コンソールに以下のようなメッセージが表示されます。
Cannot perform upm operation: Unable to add package [https://mycompany.github.com/gitproject/com.mycompany.mypackage.git]:
Error when executing git command. fatal: repository 'https://mycompany.github.com/gitproject/com.mycompany.mypackage.git/' not found
[NotFound]
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:310)
入力を確認してください。正しい URL を使用していることを確認するには、リポジトリのページに移動し、Clone ボタンから URL をコピーします 。
GitHub (A) または GitLab (B) の URL の右にあるボタンをクリックして、URL をクリップボードにコピーします。
認証を必要とするプライベートリポジトリからパッケージをインストールしようとすると、Unity コンソールに以下のようなメッセージが表示されます。
Cannot perform upm operation: Unable to add package [https://mycompany.github.com/gitproject/com.mycompany.mypackage.git]:
Error when executing git command. fatal: could not read Username for 'https://mycompany.github.com': terminal prompts disabled
[NotFound]
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:310)
Git リポジトリのクローンやフェッチを行う際の認証に使用される最も一般的な 2 つのプロトコルは、HTTP(S) と SSH (つまり、一組の公開と秘密の SSH キー) です。
HTTP(S) では、GitHub や GitLab にログオンするたびに、ターミナルやダイアログボックスでユーザー名とパスワードを入力する必要があります。
SSH を使用すると、パブリック SSH キーを GitHub または GitLab に追加し、ユーザー名とパスワードを入力せずにリポジトリにアクセスできます。
ただし、SSH キーを安全に保管するためのパスフレーズを設定している場合でも、 キーを認証するには、ターミナルまたはダイアログボックスにそのパスフレーズを入力する必要があります。
Git が使用するプロトコルの違いの概要は、プロトコル使用に関する Git ドキュメントを参照してください。
Package Manager には、HTTP のユーザー名とパスワードを入力するためのインタラクティブなターミナルやダイアログ、または SSH キーをアンロックするためのパスフレーズはありません。これを避けるには、以下の回避策のいずれかを使用します。
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.