Version 3.3.1.2

OdinMenuStyle class

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector.Editor
public class OdinMenuStyle

The style settings used by OdinMenuItem.

A nice trick to style your menu is to add the tree.DefaultMenuStyle to the tree itself, and style it live. Once you are happy, you can hit the Copy CSharp Snippet button, remove the style from the menu tree, and paste the style directly into your code.

Inheritance
  • System.Object
  • OdinMenuStyle

Constructors

OdinMenuStyle()
public OdinMenuStyle()

Fields

AlignTriangleLeft
Whether or not to align the triangle left or right of the content. If right, then the icon is pushed all the way to the right at a fixed position ignoring the indent level.
[BoxGroup("Triangle", true, false, 0F)]
public bool AlignTriangleLeft
BorderAlpha
The border alpha.
[BoxGroup("Borders", true, false, 0F)]
[EnableIf("Borders")]
public float BorderAlpha
BorderPadding
The horizontal border padding.
[BoxGroup("Borders", true, false, 0F)]
[EnableIf("Borders")]
public float BorderPadding
Borders
Whether to draw borders between menu items.
[BoxGroup("Borders", true, false, 0F)]
public bool Borders
DrawFoldoutTriangle
Whether to draw the a foldout triangle for menu items with children.
[BoxGroup("Triangle", true, false, 0F)]
public bool DrawFoldoutTriangle
Height
The height of the menu item.
[BoxGroup("General", true, false, 0F)]
public int Height
IconOffset
The size of the icon.
[BoxGroup("Icons", true, false, 0F)]
public float IconOffset
IconPadding
The padding between the icon and other content.
[BoxGroup("Icons", true, false, 0F)]
public float IconPadding
IconSize
The size of the icon.
[BoxGroup("Icons", true, false, 0F)]
public float IconSize
IndentAmount
The number of pixels to indent per level indent level.
[BoxGroup("General", true, false, 0F)]
public float IndentAmount
LabelVerticalOffset
The vertical offset of the menu item label
[BoxGroup("General", true, false, 0F)]
public float LabelVerticalOffset
NotSelectedIconAlpha
The transparency of icons when the menu item is not selected.
[BoxGroup("Icons", true, false, 0F)]
public float NotSelectedIconAlpha
Offset
The global offset of the menu item content
[BoxGroup("General", true, false, 0F)]
public float Offset
SelectedColorDarkSkin
The background color for when a menu item is selected.
[BoxGroup("Colors", true, false, 0F)]
public Color SelectedColorDarkSkin
SelectedColorLightSkin
The background color for when a menu item is selected.
[BoxGroup("Colors", true, false, 0F)]
public Color SelectedColorLightSkin
SelectedInactiveColorDarkSkin
The background color for when a menu item is selected.
[BoxGroup("Colors", true, false, 0F)]
public Color SelectedInactiveColorDarkSkin
SelectedInactiveColorLightSkin
The background color for when a menu item is selected.
[BoxGroup("Colors", true, false, 0F)]
public Color SelectedInactiveColorLightSkin
TrianglePadding
The padding between the foldout triangle icon and other content.
[BoxGroup("Triangle", true, false, 0F)]
public float TrianglePadding
TriangleSize
The size of the foldout triangle icon.
[BoxGroup("Triangle", true, false, 0F)]
public float TriangleSize

Properties

DefaultLabelStyle
Gets or sets the default selected style.
public GUIStyle DefaultLabelStyle { get; set; }
SelectedColor
The background color for when a menu item is selected.
public Color SelectedColor { get; }
SelectedInactiveColor
The background color for when a menu item is selected.
public Color SelectedInactiveColor { get; }
SelectedLabelStyle
Gets or sets the selected label style.
public GUIStyle SelectedLabelStyle { get; set; }
TreeViewStyle
Creates and returns an instance of a menu style that makes it look like Unity's project window.
public static OdinMenuStyle TreeViewStyle { get; }

Methods

Clone()
public OdinMenuStyle Clone()
Returns
OdinMenuStyle

SetAlignTriangleLeft(Boolean)
Sets whether or not to align the triangle left or right of the content. If right, then the icon is pushed all the way to the right at a fixed position ignoring the indent level.
public OdinMenuStyle SetAlignTriangleLeft(bool value)
Parameters
System.Boolean value

Returns
OdinMenuStyle

SetBorderAlpha(Single)
Sets the border alpha.
public OdinMenuStyle SetBorderAlpha(float value)
Parameters
System.Single value

Returns
OdinMenuStyle

SetBorderPadding(Single)
Sets the border alpha.
public OdinMenuStyle SetBorderPadding(float value)
Parameters
System.Single value

Returns
OdinMenuStyle

SetBorders(Boolean)
Sets whether to draw borders between menu items.
public OdinMenuStyle SetBorders(bool value)
Parameters
System.Boolean value

Returns
OdinMenuStyle

SetDrawFoldoutTriangle(Boolean)
Sets whether to draw the a foldout triangle for menu items with children.
public OdinMenuStyle SetDrawFoldoutTriangle(bool value)
Parameters
System.Boolean value

Returns
OdinMenuStyle

SetHeight(Int32)
Sets the height of the menu item.
public OdinMenuStyle SetHeight(int value)
Parameters
System.Int32 value

Returns
OdinMenuStyle

SetIconOffset(Single)
Sets the size of the icon.
public OdinMenuStyle SetIconOffset(float value)
Parameters
System.Single value

Returns
OdinMenuStyle

SetIconPadding(Single)
Sets the padding between the icon and other content.
public OdinMenuStyle SetIconPadding(float value)
Parameters
System.Single value

Returns
OdinMenuStyle

SetIconSize(Single)
Sets the size of the icon.
public OdinMenuStyle SetIconSize(float value)
Parameters
System.Single value

Returns
OdinMenuStyle

SetIndentAmount(Single)
Sets the number of pixels to indent per level indent level.
public OdinMenuStyle SetIndentAmount(float value)
Parameters
System.Single value

Returns
OdinMenuStyle

SetNotSelectedIconAlpha(Single)
Sets the transparency of icons when the menu item is not selected.
public OdinMenuStyle SetNotSelectedIconAlpha(float value)
Parameters
System.Single value

Returns
OdinMenuStyle

SetOffset(Single)
Sets the global offset of the menu item content
public OdinMenuStyle SetOffset(float value)
Parameters
System.Single value

Returns
OdinMenuStyle

SetSelectedColorDarkSkin(Color)
Sets the background color for when a menu item is selected.
public OdinMenuStyle SetSelectedColorDarkSkin(Color value)
Parameters
UnityEngine.Color value

Returns
OdinMenuStyle

SetSelectedColorLightSkin(Color)
Sets the background color for when a menu item is selected.
public OdinMenuStyle SetSelectedColorLightSkin(Color value)
Parameters
UnityEngine.Color value

Returns
OdinMenuStyle

SetTrianglePadding(Single)
Sets the padding between the foldout triangle icon and other content.
public OdinMenuStyle SetTrianglePadding(float value)
Parameters
System.Single value

Returns
OdinMenuStyle

SetTriangleSize(Single)
Sets the size of the foldout triangle icon.
public OdinMenuStyle SetTriangleSize(float value)
Parameters
System.Single value

Returns
OdinMenuStyle