Painter Attirbute
-
Create new class, for example
ExampleAttribute.cs
public class ExampleAttribute { }
-
Inherit from
PainterAttribute
class.public class ExampleAttribute : PainterAttribute { }
-
Optionaly add Required/Optional parameters.
public class ExampleAttribute : PainterAttribute { // Required parameter. public readonly string text; // Constructor with required parameter. public ExampleAttribute(string text) { this.text = text; } // Optional parameter. public float SomeValue { get; set; } }
Example
public class ExampleComponent : MonoBehaviour
{
// Required parameter.
[Example("Some Text")]
public float value;
// Required and optional parameter.
[Example("Some Text", Value = 10.0f)]
public float value;
}