PR

[Unity]UniRxとUniTaskがUPM(Unity Package Manager)に対応していて導入が簡単になっていた

Unity

はじめに

みなさん、UniRxUniTask使っていますか?

自分は使いこなせているわけではありませんが、所々で利用しています。

そんなUniRxUniTaskですが、導入の方法が以前の方法よりも簡単にできるようになっていたので紹介します。

環境

  • Unity 2021.1.7f1

UMPを使わない方法(古い方法)

以前はAsset StoreGitHubUnity Packageダウンロードしてインポートする方法です。

UniRx - Reactive Extensions for Unity | Integration | Unity Asset Store
Use the UniRx - Reactive Extensions for Unity from neuecc on your next project. Find this integration tool & more on the...

UPMを使う方法(新しい方法)

UniRx編

GitHubへアクセス

まずはUniRxのGitHubへアクセスします。

そしてREADME.mdUPM Packageの項目に書かれている「https://github.com/neuecc/UniRx.git?path=Assets/Plugins/UniRx/Scripts」のURLをコピーします。

GitHub - neuecc/UniRx: Reactive Extensions for Unity
Reactive Extensions for Unity. Contribute to neuecc/UniRx development by creating an account on GitHub.

UnityでUnity Package Managerを開く

Unityを開き[Window]→[Package Manager]を開きます。

さきほどコピーしたURLを設定する

Unity Package Managerの「Packages: In Project」と書かれている部分の左側にある+ボタンを押して、「Add package from git URL…」をクリックします。

表示された「Add package from git URL」の入力フォームに先程のURLをペーストして、「Add」ボタンをクリックします。

すると。。。

UniRxが無事Unity Package Managerで入ります。

Packagesの中身にしっかりとUniRxがいることがわかります。

Packagesの中身デフォルトでは非表示になっています。

これでUniRxのUPM化は終わりです。

UniTask編

GitHubへアクセス

まずはUniRxのGitHubへアクセスします。

そしてREADME.mdUPM Packageの項目に書かれている「https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask」のURLをコピーします。

GitHub - Cysharp/UniTask: Provides an efficient allocation free async/await integration for Unity.
Provides an efficient allocation free async/await integration for Unity. - GitHub - Cysharp/UniTask: Provides an efficie...

やり方はUniRxと同じ

やり方は上記でやったUniRx全く同じです。

設定すると。。。

無事、UniTaskも入りました。

PackagesにもUniTaskが追加されているのがわかります。

さいごに

全てのアセットがUPMに対応してほしい。。。

おすすめ参考書

コメント

タイトルとURLをコピーしました