Namespace: | Sirenix.OdinInspector |
Assembly: | Sirenix.OdinInspector.Attributes |
[DontApplyToListElements]
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.Delegate | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter | AttributeTargets.All, AllowMultiple = true, Inherited = true)]
[Conditional("UNITY_EDITOR")]
public sealed class InlineButtonAttribute : Attribute, _Attribute
The inline button adds a button to the end of a property.
Due to a bug, multiple inline buttons are currently not supported.
The following examples demonstrates how InlineButton can be used.
public class MyComponent : MonoBehaviour
{
// Adds a button to the end of the A property.
[InlineButton("MyFunction")]
public int A;
// This is example demonstrates how you can change the label of the button.
// InlineButton also supports refering to string members with $.
[InlineButton("MyFunction", "Button")]
public int B;
private void MyFunction()
{
// ...
}
}
public InlineButtonAttribute(string action, SdfIconType icon, string label = null)
System.String | action | A resolved string that defines the action to perform when the button is clicked, such as an expression or method invocation. |
SdfIconType | icon | The icon to be shown inside the button. |
System.String | label | Optional label of the button. |
public InlineButtonAttribute(string action, string label = null)
System.String | action | A resolved string that defines the action to perform when the button is clicked, such as an expression or method invocation. |
System.String | label | Optional label of the button. |
public string Action
public string ButtonColor
public SdfIconType Icon
public IconAlignment IconAlignment
public string Label
public string ShowIf
public string TextColor