From e846c64d6f927879cb8a095e62d773a8d7b3c9f4 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 15 Oct 2020 07:24:10 +0800 Subject: *ability system --- .../Plugins/AdvancedInspector/Attributes/Style.cs | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Style.cs (limited to 'Assets/Plugins/AdvancedInspector/Attributes/Style.cs') diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Style.cs b/Assets/Plugins/AdvancedInspector/Attributes/Style.cs new file mode 100644 index 00000000..5ffa27ac --- /dev/null +++ b/Assets/Plugins/AdvancedInspector/Attributes/Style.cs @@ -0,0 +1,43 @@ +using System; + +namespace AdvancedInspector +{ + /// + /// Allow to change the style of an field item. + /// + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Method)] + public class StyleAttribute : Attribute + { + private string style = ""; + + /// + /// Name of the style to use. + /// Must be findable by GUI.skin.Find() + /// + public string Style + { + get { return style; } + set { style = value; } + } + + private bool label = true; + + /// + /// Force or prevent the field's label from being displayed. + /// + public bool Label + { + get { return label; } + set { label = value; } + } + + public StyleAttribute(string style) + : this(style, true) { } + + public StyleAttribute(string style, bool label) + { + this.style = style; + this.label = label; + } + } +} \ No newline at end of file -- cgit v1.1-26-g67d0