GUIContent

作者:追风剑情 发布于:2015-11-26 17:45 分类:GUI

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)))
        {

        }
	}
}

运行效果

run.png

标签: GUI

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号