端末の環境

System Version:	macOS 11.6.2 (20G314)
Kernel Version:	Darwin 20.6.0
Boot Volume:	Macintosh HD
Model Name:	MacBook Air
Model Identifier:	MacBookAir10,1
Chip:	Apple M1
Total Number of Cores:	8 (4 performance and 4 efficiency)
Memory:	8 GB
System Firmware Version:	7429.61.2
OS Loader Version:	6723.140.2

Unity Hubのインストール

こちらからUnity Hubをインストールします。

https://unity.com/download

Unity Hubを起動してログインします。

Unity Hubから新規プロジェクトを作成

今回使用するUnityのバージョンは 2021.3.7f1 です。

Coreを選択して3Dを選択してCreate projectをクリックします。

https://user-images.githubusercontent.com/1194571/184542128-7414d6ef-5542-4a46-87e0-4ad90cc696ab.png

OpenCV plus Unityのインストール

こちらのページからマイアセットに追加します。

https://assetstore.unity.com/packages/tools/integration/opencv-plus-unity-85928?locale=ja-JP

追加できたら、UnityのPackage ManagerからDownloadボタンを押してダウンロードします。

https://user-images.githubusercontent.com/1194571/184542155-745f6829-5c37-4222-a1f3-bc55bed08b01.png

ダウンロードが終わるとImportできるようになるのでImportボタンをクリックします。

https://user-images.githubusercontent.com/1194571/184542177-9be385c6-7ee6-417f-aea4-343c4c3a2616.png

Importが終わるとProjectの中にOpenCV+Unityが表示されます。

https://user-images.githubusercontent.com/1194571/184542196-ff38f51b-9e07-4247-aa21-bf68b1cc8652.png

こちらの記事を参考にFile>BuildSettings>PlayerSettingsを開いてOtherSettingsの"Allow 'unsafe' Code"の部分にチェックを入れます。