はじめに
今日はUnityの勉強していきます。
↑のアセットをダウンロードしてインポートしたらエラーが出てきました。
Assets/Standard Assets/Effects/ImageEffects/Scripts/DepthOfField.cs(9,33): error CS0246: The type or namespace name 'PostEffectsBase' could not be found (are you missing a using directive or an assembly reference?) Assets/Standard Assets/Effects/ImageEffects/Scripts/BloomOptimized.cs(9,35): error CS0246: The type or namespace name 'PostEffectsBase' could not be found (are you missing a using directive or an assembly reference?) Assets/Standard Assets/Effects/ImageEffects/Scripts/DepthOfField.cs(55,30): error CS0115: 'DepthOfField.CheckResources()': no suitable method found to override Assets/Standard Assets/Effects/ImageEffects/Scripts/BloomOptimized.cs(42,30): error CS0115: 'BloomOptimized.CheckResources()': no suitable method found to override
これの解決方法について共有したいと思います。
環境
この記事の情報は次のバージョンで動作確認しています。
MacOS Monterey (12.1)
Unity (2021.2.9f1)
~~~~~~~Unityアセット~~~~~~~~
Technical laboratory designer-V1 Room (Version1.0)
原因
エラーが出ているのはImageEffectという部分なのですが、今廃止になってるようです。
代替えとしてLagacy Image EffectというのがAssetStoreからダウンロードできたたらしいのですが、 2022年5月現在ではダウンロードできなくなってました。。
残念。
強制的にエラーを取る
ImageEffectのフォルダを削除するとエラーが消えます。
消しても表示がおかしいといったことは今のところなさそうでした。
おわりに
Unityのアセットは古くなってくるとこういったエラーが出てきますよね。なのでバージョン上げるのが怖いんですよねー。
最後まで見ていただきヘペトナス!
読者登録・Twitterのフォローもお願いします。