1.12.0: Added FieldLabelFromArrayIndex
This commit is contained in:
parent
df1d2f6df1
commit
23b24d42d3
6 changed files with 71 additions and 1 deletions
26
Runtime/Predrawers/FieldLabelFromArrayIndexAttribute.cs
Normal file
26
Runtime/Predrawers/FieldLabelFromArrayIndexAttribute.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
|
||||
namespace Module.Inspector
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class FieldLabelFromArrayIndexAttribute : PredrawerModifierPropertyAttribute
|
||||
{
|
||||
public readonly string prefix;
|
||||
public readonly string postfix;
|
||||
public readonly int offset;
|
||||
|
||||
public FieldLabelFromArrayIndexAttribute(string prefix, int offset = 0)
|
||||
{
|
||||
this.prefix = prefix;
|
||||
postfix = null;
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
public FieldLabelFromArrayIndexAttribute(string prefix, string postfix, int offset = 0)
|
||||
{
|
||||
this.prefix = prefix;
|
||||
this.postfix = postfix;
|
||||
this.offset = offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue