using UnityEngine;
using System.Collections;
public class GUILabel : MonoBehaviour {
void OnGUI () {
// 画一个黄色的标签
GUI.color = Color.yellow;
GUI.Label (new Rect(10, 10, 100, 20), "Hello World!");
// 再画一个红色的标签
GUI.color = Color.red;
GUI.Label (new Rect(10, 40, 100, 20), "Hello World!");
}
}
运行效果