うにてぃブログ

主にUnityとC#に関する記事を書いていきます

【Unity】Script 'Packages/*.cs' will not be compiled because it exists outside the Assets folder and does not to belong to any assembly definition file.

自作ライブラリを PackageManager で利用できるように対応したところ下記 Waring が出ていました

Script 'Packages/*.cs' will not be compiled because it exists outside the Assets folder and does not to belong to any assembly definition file.

Warning の内容は assembly definition file がないので追加しろということでした

コンパイル時間の短縮や、依存関係の解決を容易にするために、assembly definition file が必要なんだと思います

解決方法

warning の解決には assembly definition file があればいいだけなので、
右クリックメニューから assembly definition file を作成しライブラリに同封してあげるだけです

f:id:hacchi_man:20201123022449p:plain:w400