当我保存我的脚本时,它会出现这些错误:
Assets / Player Controller.cs(38,128):错误CS1526:新表达式在类型后需要()或[]。
和这个
Assets / Player Controller.cs(38,129):错误CS8032:解析期间内部编译器错误,使用-v运行以获取详细信息。
我研究了它,但没有答案。有人可以帮忙吗?问题出在这一行:
GUI.TextField (new Rect (Screen.width / 2 - 65, Screen.height / 2 - 11, 130, 22) "Do something to start"); }
答案 0 :(得分:4)
您在GUI.TextField(Rect, string)
constructor的Rect
和string
参数之间缺少逗号。
请改为尝试:
GUI.TextField (new Rect (Screen.width / 2 - 65, Screen.height / 2 - 11, 130, 22), "Do something to start"); }
另外,考虑跨多行格式化以使结构更清晰(这样的错误更容易发现):
GUI.TextField(
new Rect(Screen.width / 2 - 65, Screen.height / 2 - 11, 130, 22),
"Do something to start");
}