public static Color color ;

描述

GUI 的全局着色颜色。

将影响背景和文本颜色。

另请参阅:backgroundColorcontentColor

\ GUI 控件上的黄色。

// Tints all GUI drawn elements with yellow.

using UnityEngine; using System.Collections;

public class ExampleClass : MonoBehaviour { void OnGUI() { GUI.color = Color.yellow; GUI.Label(new Rect(10, 10, 100, 20), "Hello World!"); GUI.Box(new Rect(10, 50, 50, 50), "A BOX"); GUI.Button(new Rect(10, 110, 70, 30), "A button"); } }