[FieldButton]

Attribute used for displaying a button above the field that invokes a method when clicked.

Parameters

Parameter Name
Arguments
Description

name

string

Name of the method to invoke when button is clicked.

Label

string

Click Me, @_Popup, @Assets/Texture.png

Custom name for button. Use the @ prefix to indicate, that a texture will be used instead of the name.

Height

float

Custom button height.

Style

string

Custom button style.

Examples

[FieldButton("OnButtonClick", Label = "Click Me")]
public string buttonField;

private void OnButtonClick()
{
    Debug.Log("Button Clicked!");
}

[FieldButton("ResetValue", Label = "Reset", Height = 30)]
public int value;

private void ResetValue()
{
    value = 0;
}

Last updated