0
我想在Unity3D的运行时动态创建一些GUIText。在运行时创建GUIText文件
void start()
{
GameObject bananas = new GameObject("SomeGUIText");
Instantiate(bananas);
GUIText myText = bananas.AddComponent<GUIText>();
myText.transform.position = new Vector3(0.5f,0.5f,0f);
myText.guiText.text = "Hello";
}
没有错误,只是没有出现!我错过了什么?
在start()中大写“s” – SirBraneDamuj
Nooooooooooooooooooooooooooooooooooooooooooooo!#SirBraneDamuj复制一下,&我会接受这个答案! –