You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
784 B
33 lines
784 B
using System; |
|
|
|
namespace NaughtyAttributes |
|
{ |
|
public enum EButtonEnableMode |
|
{ |
|
/// <summary> |
|
/// Button should be active always |
|
/// </summary> |
|
Always, |
|
/// <summary> |
|
/// Button should be active only in editor |
|
/// </summary> |
|
Editor, |
|
/// <summary> |
|
/// Button should be active only in playmode |
|
/// </summary> |
|
Playmode |
|
} |
|
|
|
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] |
|
public class ButtonAttribute : SpecialCaseDrawerAttribute |
|
{ |
|
public string Text { get; private set; } |
|
public EButtonEnableMode SelectedEnableMode { get; private set; } |
|
|
|
public ButtonAttribute(string text = null, EButtonEnableMode enabledMode = EButtonEnableMode.Always) |
|
{ |
|
this.Text = text; |
|
this.SelectedEnableMode = enabledMode; |
|
} |
|
} |
|
}
|
|
|