using UnityEngine; using System.Collections; public class GUITest : MonoBehaviour { public Texture texture; public string text = "button text"; public string toolTip = "button toolTip"; void OnGUI () { if (GUILayout.Button(new GUIContent(text, texture, toolTip))) { } } }
运行效果