GUIContent.image 界面图片

var image : Texture

Description描述

The icon image contained.

包含的图标图片。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public Texture icon;
	void OnGUI() {
		if (!typeof(icon)) {
			Debug.LogError("Add a texture on the inspector first");
			return;
		}
		GUI.Button(new Rect(0, 0, 100, 20), new GUIContent(icon));
	}
}
var icon : Texture;

function OnGUI () {
	if(!icon) {
		Debug.LogError("Add a texture on the inspector first");
		return;
	}
	GUI.Button (Rect (0, 0, 100, 20), GUIContent (icon));
}
Page last updated: 2011-1-2