unity 3d can`t add script behaviour Assemblytnfo. The script need to derive from MonoBehaviour

can`t add script behaviour Assemblytnfo. The script need to derive from MonoBehaviour
在使用给组件添加脚本,是必不可缺的内容。目前的unity 3d 软件已经取消了支持js脚本,只剩下了c#。
所以在使用C#脚本的过程中,需要注意,所使用脚本中的类,需要继承MonoBehaviour这个类。这是一个基类,所有的组建类都是从这个类衍生出来。
所以如果出现上面这个错误:

unity 3d can`t add script behaviour Assemblytnfo. The script need to derive from MonoBehaviour

就要看看脚本里面是否有继承这个类:

unity 3d can`t add script behaviour Assemblytnfo. The script need to derive from MonoBehaviour

此外,还有一个很蛋疼的原因,就是脚本的命名出现了空格,如下:

unity 3d can`t add script behaviour Assemblytnfo. The script need to derive from MonoBehaviour
这可能是unity3d的一个限制,脚本命名的时候,需要多留心。
 

 

ps:我的问题是命名有空格