Renamed all attributes and drawers to have postfix of either Attribute or AttributeDrawer

This commit is contained in:
Anders Ejlersen 2021-12-04 12:47:44 +01:00
parent 81bac32538
commit dc15bfec81
161 changed files with 265 additions and 265 deletions

View file

@ -3,12 +3,12 @@ using UnityEngine;
namespace Module.Inspector.Editor
{
[CustomPropertyDrawer(typeof(ArrayIndex))]
internal sealed class DrawerArrayIndex : ValueModifierPropertyDrawer
[CustomPropertyDrawer(typeof(ArrayIndexAttribute))]
internal sealed class ArrayIndexAttributeDrawer : ValueModifierPropertyDrawer
{
public override void Modify(ValueModifierPropertyAttribute attribute, SerializedProperty property)
{
var att = (ArrayIndex)attribute;
var att = (ArrayIndexAttribute)attribute;
int arraySize = GetSiblingArraySize(property, att);
int max = arraySize > 0 ? arraySize - 1 : 0;
@ -18,7 +18,7 @@ namespace Module.Inspector.Editor
property.intValue = value;
}
private static int GetSiblingArraySize(SerializedProperty sp, ArrayIndex att)
private static int GetSiblingArraySize(SerializedProperty sp, ArrayIndexAttribute att)
{
SerializedProperty spSibling = sp.GetSibling(att.fieldName);
return spSibling != null && spSibling.isArray ? spSibling.arraySize : 0;

View file

@ -2,12 +2,12 @@
namespace Module.Inspector.Editor
{
[CustomPropertyDrawer(typeof(LargerThanField))]
internal sealed class DrawerLargerThanField : ValueModifierPropertyDrawer
[CustomPropertyDrawer(typeof(LargerThanFieldAttribute))]
internal sealed class LargerThanFieldAttributeDrawer : ValueModifierPropertyDrawer
{
public override void Modify(ValueModifierPropertyAttribute attribute, SerializedProperty property)
{
var att = (LargerThanField)attribute;
var att = (LargerThanFieldAttribute)attribute;
SerializedPropertyExtension.ECompareType compareType = property.IsGreaterOrEqualToSiblingValue(att.fieldName);
if (compareType == SerializedPropertyExtension.ECompareType.False)

View file

@ -3,12 +3,12 @@ using UnityEngine;
namespace Module.Inspector.Editor
{
[CustomPropertyDrawer(typeof(MaxValue))]
internal sealed class DrawerMaxValue : ValueModifierPropertyDrawer
[CustomPropertyDrawer(typeof(MaxValueAttribute))]
internal sealed class MaxValueAttributeDrawer : ValueModifierPropertyDrawer
{
public override void Modify(ValueModifierPropertyAttribute attribute, SerializedProperty property)
{
var max = (MaxValue)attribute;
var max = (MaxValueAttribute)attribute;
switch (property.propertyType)
{

View file

@ -3,12 +3,12 @@ using UnityEngine;
namespace Module.Inspector.Editor
{
[CustomPropertyDrawer(typeof(MinValue))]
internal sealed class DrawerMinValue : ValueModifierPropertyDrawer
[CustomPropertyDrawer(typeof(MinValueAttribute))]
internal sealed class MinValueAttributeDrawer : ValueModifierPropertyDrawer
{
public override void Modify(ValueModifierPropertyAttribute attribute, SerializedProperty property)
{
var min = (MinValue)attribute;
var min = (MinValueAttribute)attribute;
switch (property.propertyType)
{

View file

@ -2,12 +2,12 @@
namespace Module.Inspector.Editor
{
[CustomPropertyDrawer(typeof(SmallerThanField))]
internal sealed class DrawerSmallerThanField : ValueModifierPropertyDrawer
[CustomPropertyDrawer(typeof(SmallerThanFieldAttribute))]
internal sealed class SmallerThanFieldAttributeDrawer : ValueModifierPropertyDrawer
{
public override void Modify(ValueModifierPropertyAttribute attribute, SerializedProperty property)
{
var att = (SmallerThanField)attribute;
var att = (SmallerThanFieldAttribute)attribute;
SerializedPropertyExtension.ECompareType compareType = property.IsSmallerOrEqualToSiblingValue(att.fieldName);
if (compareType == SerializedPropertyExtension.ECompareType.False)