Skip to content

Bottom Button

[BottomButton] attribute used adding button to field placed in bottom.


Support Types

Any fields


Parameters

Parameter Name Description
Name Name of method.
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/...
Group Group name of buttons.
Height Custom button height.
Style Custom style for button.

Examples

[ButtomButton("Function")]
public float value;

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
{
    [BottomButton("FirstFunction", Label = "First Function", Group = "Functions Group", Style = "ButtonLeft")]
    [BottomButton("SecondFunction", Label = "Second Function", Group = "Functions Group", Style = "ButtonRight")]
    public float value;

    public void FirstFunction()
    {
        value = 10;
    }

    public void SecondFunction()
    {
        value = 30;
    }
}

Live-demo

Live demo