GUISkin.toggle 开关按钮

var toggle : GUIStyle

Description描述

Style used by default for GUI.Toggle controls.

用于GUI.Toggle控件的默认样式。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public GUIStyle style;
	private bool val = false;
	void OnGUI() {
		GUI.skin.toggle = style;
		val = GUILayout.Toggle(val, "A Toggle control");
	}
}
// Modifies only the toggle style of the current GUISkin
//修改当前GUISkin的toggle样式

var style : GUIStyle;
private var val : boolean = false;

function OnGUI() {
    GUI.skin.toggle = style;
    val = GUILayout.Toggle(val,"A Toggle control");
}
Page last updated: 2011-1-25