比如:
Can't add script component 'UICurrentLocationAndNPC' because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name match.
就是类名跟C#文件名不一样,导致挂载不了,但是你会发现,哎呀,这明明他喵的一样啊
如果你确保真的没问题,那就尝试把你的类名后面的空格去掉!
出问题了,类名后面就不要存在空格
这样基本就没问题了,我也不懂为什么会这样,但是创建脚本默认后面都有空格
很多次都是因为这个问题导致之前的脚本引用失效,