Scripting API¶
EditorIcons class (editor-only)¶
⚠️ This class is available only for Editor features.
GetIcon()¶
Gets the texture of a named icon alone.
string name: The name of the icon you want to get, as defined from the Material Icons listbool black = false: Do you want to get the black version of the icon?bool x2 = false: Do you want the doubled size of the icon?
IconContent()¶
public static GUIContent IconContent(string iconName, string text, string tooltip, bool black = false, bool x2 = false);
public static GUIContent IconContent(string iconName, string tooltip, bool black = false, bool x2 = false);
public static GUIContent IconContent(string iconName, bool black = false, bool x2 = false);
Creates a GUIContent, using the named icon as content's icon.
string iconName: The name of the icon you want to get, as defined from the Material Icons liststring text: The text of the outputGUIContentstring tooltip: The tooltip of the outputGUIContentbool black = false: Do you want to get the black version of the icon?bool x2 = false: Do you want the doubled size of the icon?
IconButton()¶
public static bool IconButton(Rect position, string iconName, GUIContent label);
public static bool IconButton(Rect position, string iconName, string label, string tooltip);
public static bool IconButton(Rect position, string iconName, string label);
public static bool IconButton(Rect position, string iconName);
public static bool IconButton(string iconName, GUIContent label, params GUILayoutOption[] options);
public static bool IconButton(string iconName, string label, string tooltip, params GUILayoutOption[] options);
public static bool IconButton(string iconName, string label, params GUILayoutOption[] options);
public static bool IconButton(string iconName, params GUILayoutOption[] options);
Gets the texture of a named icon alone.
Rect position: Rectangle on the screen to use for the button.string iconName: The name of the icon you want to get, as defined from the Material Icons list.GUIContent|string label: Content|Text for this buttonstring tooltip: Tooltip for this buttonGUILayoutOptions[] options: Options for the rectangle on the screen to use for the button