Skip to content

Button

[Button] attribute used adding button to inspector.


Support Types

Any methods


Parameters

Parameter Name Description
Label Custom name for button.
Use the @ prefix to indicate, that a texture will be used instead of the name.
Arguments: @{Default Unity Icon Name}, @{Path to texture}
Example: @_Popup, @Assets/...
Height Custom button height.
Style Custom style for button.

Examples

[Button]
public void Function()
{
    //...
}
Note

Make sure that you have added ApexInspector namespace in your script, to get access to all attributes.

using ApexInspector;


Demo

using ApexInspector;
using UnityEngine;

public class ExampleComponent : MonoBehaviour
{
    public float value;

    [Button]
    public void FirstFunction()
    {
        Debug.Log("Called First Function!");
    }
}

Live-demo

Live demo