以下是发生的事情:
在场景一中:
void OnGUI() {
string _text = "Options";
GUIContent content = new GUIContent ();
content.image = (Texture2D)imageForTexture;
content.text = _text;
GUI.skin.button.normal.background = (Texture2D)content.image;
GUI.skin.button.hover.background = (Texture2D)content.image;
GUI.skin.button.active.background = (Texture2D)content.image;
GUIStyle myButtonStyle = new GUIStyle(GUI.skin.button);
myButtonStyle.fontSize = 20;
myButtonStyle.normal.textColor = Color.green;
GUI.Button(new Rect(Screen.width/2-700, Screen.height/2 -200 ,300,100),content,myButtonStyle);
}
在场景二中:
void OnGUI()
{
GUI.Button(new Rect(Screen.width/2-700, Screen.height/2 -200 ,300,100),"Instruction");
}
这里的按钮是什么样的:
您的经验始终是支持性的。提前谢谢!