using System;
namespace GlitchyEngine.Editor;
public enum ButtonVisibility
{
///
/// The button will be visible in edit mode.
///
InEditMode = 1,
///
/// The button will be visible in play mode.
///
InPlayMode = 2,
///
/// The button will always be visible.
///
Always = InEditMode | InPlayMode
}
///
/// Specifies that a button will be shown in the editor that, when clicked, executes the method this attribute is attached to.
///
[AttributeUsage(AttributeTargets.Method)]
public sealed class ShowButtonAttribute : Attribute
{
///
/// The text on the button.
///
public string ButtonText { get; private set; }
///
/// Determines whether the button is visible in edit and/or play mode.
///
public ButtonVisibility Visibility { get; set; } = ButtonVisibility.Always;
public ShowButtonAttribute(string buttonText)
{
ButtonText = buttonText;
}
}