GUISkin.GetStyle Manual     Reference     Scripting  
Scripting > Runtime Classes > GUISkin
GUISkin.GetStyle

function GetStyle (styleName : String) : GUIStyle

Parameters

NameDescription
styleName Name of the GUIStyle to get.

Returns

GUIStyle - The requested GUIStyle.

Description

Get a named GUIStyle.

JavaScript
private var b : boolean;

function OnGUI() {
b = GUILayout.Toggle(b, "A toggle button", GUI.skin.GetStyle("Button"));
}

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
private bool b;
void OnGUI() {
b = GUILayout.Toggle(b, "A toggle button", GUI.skin.GetStyle("Button"));
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

private b as bool

def OnGUI():
b = GUILayout.Toggle(b, 'A toggle button', GUI.skin.GetStyle('Button'))