Button Attribute

Buttons are used on functions, and allows for clickable buttons in the inspector.

public string ButtonName = "Dynamic button name";

public bool Toggle;

[Button("$ButtonName")]
private void DefaultSizedButton()
{
    this.Toggle = !this.Toggle;
}

[Button("@\"Expression label: \" + DateTime.Now.ToString(\"HH:mm:ss\")")]
public void ExpressionLabel()
{
    this.Toggle = !this.Toggle;
}

[Button("Name of button")]
private void NamedButton()
{
    this.Toggle = !this.Toggle;
}

[Button(ButtonSizes.Small)]
private void SmallButton()
{
    this.Toggle = !this.Toggle;
}

[Button(ButtonSizes.Medium)]
private void MediumSizedButton()
{
    this.Toggle = !this.Toggle;
}

[DisableIf("Toggle")]
[HorizontalGroup("Split", 0.5f)]
[Button(ButtonSizes.Large), GUIColor(0.4f, 0.8f, 1)]
private void FanzyButton1()
{
    this.Toggle = !this.Toggle;
}

[HideIf("Toggle")]
[VerticalGroup("Split/right")]
[Button(ButtonSizes.Large), GUIColor(0, 1, 0)]
private void FanzyButton2()
{
    this.Toggle = !this.Toggle;
}

[ShowIf("Toggle")]
[VerticalGroup("Split/right")]
[Button(ButtonSizes.Large), GUIColor(1, 0.2f, 0)]
private void FanzyButton3()
{
    this.Toggle = !this.Toggle;
}

[Button(ButtonSizes.Gigantic)]
private void GiganticButton()
{
    this.Toggle = !this.Toggle;
}

[Button(90)]
private void CustomSizedButton()
{
    this.Toggle = !this.Toggle;
}

[Button]
private void Default(float a, float b, GameObject c)
{
}

[Button]
private void Default(float t, float b, float[] c)
{
}

[Button(ButtonSizes.Medium, ButtonStyle.FoldoutButton)]
private int FoldoutButton(int a = 2, int b = 2)
{
    return a + b;
}

[Button(ButtonSizes.Medium, ButtonStyle.FoldoutButton)]
private void FoldoutButton(int a, int b, ref int result)
{
    result = a + b;
}

[Button(ButtonStyle.Box)]
private void Full(float a, float b, out float c)
{
    c = a + b;
}

[Button(ButtonSizes.Large, ButtonStyle.Box)]
private void Full(int a, float b, out float c)
{
    c = a + b;
}

[Button(ButtonStyle.CompactBox, Expanded = true)]
private void CompactExpanded(float a, float b, GameObject c)
{
}

[Button(ButtonSizes.Medium, ButtonStyle.Box, Expanded = true)]
private void FullExpanded(float a, float b)
{
}