InlineButtonAttribute

The inline button adds a button to the end of a property.

namespace Sirenix.OdinInspector
{
[AttributeUsageAttribute((AttributeTargets)384, AllowMultiple = True, Inherited = True)]
public sealed class InlineButtonAttribute : Attribute
}

Requirements

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector
Version: 1.0.5.0

See Also

Constructors

Definition Description
InlineButtonAttribute(string, string) Draws a button to the right of the property.

Properties

Return Type Definition Description
string Label Optional label of the button.
string MemberMethod Name of member method to call when the button is clicked.

Example

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()
	{
		// ...
	}
}