/// <summary> /// Creates an instance of ExtendedObjectFieldButton. /// </summary> /// <param name="_IconType">The type of icon to use for this button.</param> /// <param name="_Tooltip">The hovering tooltip to use for this button.</param> /// <param name="_OnClick">The action to perform when the user clicks on the button.</param> /// <param name="_Enabled">Defines if this button is enabled.</param> public ExtendedObjectFieldButton(EEditorIcon _IconType, string _Tooltip, Action _OnClick, bool _Enabled = true) { icon = EditorIcons.FindIcon(_IconType); tooltip = _Tooltip; onClick = _OnClick; enabled = _Enabled; }
/// <summary> /// Creates an instance of ExtendedObjectFieldButton. /// </summary> /// <param name="_IconType">The type of icon to use for this button.</param> /// <param name="_Position">The expected position of the button when drawing the Extended Object Field.</param> /// <param name="_OnClick">The action to perform when the user clicks on the button.</param> /// <param name="_Enabled">Defines if this button is enabled.</param> public ExtendedObjectFieldButton(EEditorIcon _IconType, EPosition _Position, Action _OnClick, bool _Enabled = true) { icon = EditorIcons.FindIcon(_IconType); position = _Position; onClick = _OnClick; enabled = _Enabled; }
/// <summary> /// Gets an editor icon by type. /// </summary> public static Texture FindIcon(EEditorIcon _IconType) { if (ICONS.TryGetValue(_IconType, out Texture icon)) { return(icon); } return(null); }
/// <summary> /// Creates a GUIContent instance that contains the given icon. /// </summary> /// <param name="_IconType">The type of the icon.</param> /// <param name="_Text">The optional text of the given content.</param> /// <param name="_Tooltip">The optional hovering tooltip of the content.</param> /// <returns>Returns the created GUIContent instance.</returns> public static GUIContent IconContent(EEditorIcon _IconType, string _Text, string _Tooltip) { return(IconContent(FindIcon(_IconType), _Text, _Tooltip)); }