Unity报错4,系统提示的错误
云引综
编辑于 2020年11月26日 22:20
收录于文集
共7篇

Assets\B.cs(19,15): error CS1061: 'Text&#​39; does not contain a definition for 'Text&#​39; and no accessible extension method 'Text&#​39; accepting a first argument of type 'Text&#​39; could be found (are you missing a using directive or an assembly reference?)

翻译

Assets\B.cs(19,15):错误CS1061:“Text”不包含“Text”的定义,并且找不到接受“Text”类型的第一个参数的可访问扩展方法“Text”(是否缺少using指令或程序集引用?)

其实就是属性值写错了,导致提示错误。

错误代码:

textF.Text = "失败了!&#​34;;

正确代码:

textF.text = "失败了!&#​34;;