2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Unity]ScriptableObjectのScript項目がNoneになる

Last updated at Posted at 2021-05-13

あれ、Script項目がNoneになってる?

ScriptableObjectのアセットを作成した際に、Scriptエリアがnullになってしまうことはなかったでしょうか。

image.png

原因

こちら、ファイル名とScriptのクラス名が違っていることで起こっているかもしれないので、クラス名とファイル名を一致させれば解決するケースがあると思います。

image.png

image.png

解決法

上記のファイル名とクラス名を同じ名前に変更すると…
image.png

この通り、Noneではなくなりました。
image.png

MonoBehaviorと同じで、スクリプト名とクラス名を一致させないと、Unity側が認識してくれていないようですので、ご注意を。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?