Added FieldLabelFrom attribute

This commit is contained in:
Anders Ejlersen 2021-12-04 12:36:50 +01:00
parent 52ee51c61c
commit 81bac32538
6 changed files with 60 additions and 0 deletions

3
Runtime/Predrawers.meta Normal file
View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 968b630d4caa4605886ae1c1d7f3bdd8
timeCreated: 1638612567

View file

@ -0,0 +1,23 @@
using System;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class FieldLabelFromAttribute : PredrawerModifierPropertyAttribute
{
public readonly string fieldName;
public readonly bool nicify;
public FieldLabelFromAttribute(string fieldName)
{
this.fieldName = fieldName;
nicify = true;
}
public FieldLabelFromAttribute(string fieldName, bool nicify)
{
this.fieldName = fieldName;
this.nicify = nicify;
}
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b3ebd4bca514492f87bc5660d98a1a6c
timeCreated: 1638612604