Renamed all attributes and drawers to have postfix of either Attribute or AttributeDrawer
This commit is contained in:
parent
81bac32538
commit
dc15bfec81
161 changed files with 265 additions and 265 deletions
|
|
@ -5,8 +5,8 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(EnumFlag))]
|
||||
internal sealed class DrawerEnumFlag : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(EnumFlagAttribute))]
|
||||
internal sealed class EnumFlagAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
public override bool Draw(Rect position, DrawerPropertyAttribute attribute, SerializedProperty property, GUIContent label, EditorPropertyUtility.Result result)
|
||||
{
|
||||
|
|
@ -4,15 +4,15 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(FilePath))]
|
||||
internal sealed class DrawerFilePath : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(FilePathAttribute))]
|
||||
internal sealed class FilePathAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
public override bool Draw(Rect position, DrawerPropertyAttribute attribute, SerializedProperty property, GUIContent label, EditorPropertyUtility.Result result)
|
||||
{
|
||||
if (property.propertyType != SerializedPropertyType.String)
|
||||
return false;
|
||||
|
||||
var att = (FilePath)attribute;
|
||||
var att = (FilePathAttribute)attribute;
|
||||
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
{
|
||||
|
|
@ -4,15 +4,15 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(FolderPath))]
|
||||
internal sealed class DrawerFolderPath : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(FolderPathAttribute))]
|
||||
internal sealed class FolderPathAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
public override bool Draw(Rect position, DrawerPropertyAttribute attribute, SerializedProperty property, GUIContent label, EditorPropertyUtility.Result result)
|
||||
{
|
||||
if (property.propertyType != SerializedPropertyType.String)
|
||||
return false;
|
||||
|
||||
var att = (FolderPath)attribute;
|
||||
var att = (FolderPathAttribute)attribute;
|
||||
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
{
|
||||
|
|
@ -5,8 +5,8 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(IntToAnimatorParameter))]
|
||||
internal sealed class DrawerIntToAnimatorParameter : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(IntToAnimatorParameterAttribute))]
|
||||
internal sealed class IntToAnimatorParameterAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
private readonly List<string> names = new List<string>();
|
||||
private readonly List<int> hashes = new List<int>();
|
||||
|
|
@ -17,7 +17,7 @@ namespace Module.Inspector.Editor
|
|||
if (property.propertyType != SerializedPropertyType.Integer)
|
||||
return false;
|
||||
|
||||
var att = (IntToAnimatorParameter)attribute;
|
||||
var att = (IntToAnimatorParameterAttribute)attribute;
|
||||
SerializedProperty spSibling = property.GetSibling(att.animatorFieldName);
|
||||
|
||||
if (spSibling == null)
|
||||
|
|
@ -50,7 +50,7 @@ namespace Module.Inspector.Editor
|
|||
if (property.propertyType != SerializedPropertyType.Integer)
|
||||
return "Only supports integers";
|
||||
|
||||
var att = (IntToAnimatorParameter)attribute;
|
||||
var att = (IntToAnimatorParameterAttribute)attribute;
|
||||
return $"Missing field: {att.animatorFieldName}";
|
||||
}
|
||||
|
||||
|
|
@ -5,8 +5,8 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(IntToEnum))]
|
||||
internal sealed class DrawerIntToEnum : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(IntToEnumAttribute))]
|
||||
internal sealed class IntToEnumAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
private GUIContent[] names;
|
||||
private int[] values;
|
||||
|
|
@ -16,7 +16,7 @@ namespace Module.Inspector.Editor
|
|||
if (property.propertyType != SerializedPropertyType.Integer)
|
||||
return false;
|
||||
|
||||
var att = (IntToEnum)attribute;
|
||||
var att = (IntToEnumAttribute)attribute;
|
||||
FetchLayerNames(att);
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
|
@ -42,7 +42,7 @@ namespace Module.Inspector.Editor
|
|||
return "Only supports integers";
|
||||
}
|
||||
|
||||
private void FetchLayerNames(IntToEnum attribute)
|
||||
private void FetchLayerNames(IntToEnumAttribute attribute)
|
||||
{
|
||||
if (names != null)
|
||||
return;
|
||||
|
|
@ -6,8 +6,8 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(IntToLayer))]
|
||||
internal sealed class DrawerIntToLayer : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(IntToLayerAttribute))]
|
||||
internal sealed class IntToLayerAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
private static GUIContent[] NAMES;
|
||||
private static int[] INDICES;
|
||||
|
|
@ -3,12 +3,12 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomMethodDrawer(typeof(MethodButton))]
|
||||
internal sealed class DrawerMethodButton : DrawerMethodDrawer
|
||||
[CustomMethodDrawer(typeof(MethodButtonAttribute))]
|
||||
internal sealed class MethodButtonAttributeDrawer : DrawerMethodDrawer
|
||||
{
|
||||
public override bool Draw(Rect position, DrawerMethodAttribute attribute, Object target, MethodInfo methodInfo)
|
||||
{
|
||||
var att = (MethodButton)attribute;
|
||||
var att = (MethodButtonAttribute)attribute;
|
||||
string name = string.IsNullOrEmpty(att.name) ? methodInfo.Name : att.name;
|
||||
|
||||
if (GUI.Button(position, name))
|
||||
|
|
@ -4,15 +4,15 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(Naming))]
|
||||
internal sealed class DrawerNaming : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(NamingAttribute))]
|
||||
internal sealed class NamingAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
public override bool Draw(Rect position, DrawerPropertyAttribute attribute, SerializedProperty property, GUIContent label, EditorPropertyUtility.Result result)
|
||||
{
|
||||
if (property.propertyType != SerializedPropertyType.String)
|
||||
return false;
|
||||
|
||||
var att = (Naming)attribute;
|
||||
var att = (NamingAttribute)attribute;
|
||||
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
{
|
||||
|
|
@ -4,8 +4,8 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(Percentage))]
|
||||
internal sealed class DrawerPercentage : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(PercentageAttribute))]
|
||||
internal sealed class PercentageAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
public override bool Draw(Rect position, DrawerPropertyAttribute attribute, SerializedProperty property, GUIContent label, EditorPropertyUtility.Result result)
|
||||
{
|
||||
|
|
@ -7,8 +7,8 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(PopupFromConst))]
|
||||
internal sealed class DrawerPopupFromConst : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(PopupFromConstAttribute))]
|
||||
internal sealed class PopupFromConstAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
private GUIContent[] names;
|
||||
private string[] values;
|
||||
|
|
@ -18,7 +18,7 @@ namespace Module.Inspector.Editor
|
|||
if (property.propertyType != SerializedPropertyType.String)
|
||||
return false;
|
||||
|
||||
var att = (PopupFromConst)attribute;
|
||||
var att = (PopupFromConstAttribute)attribute;
|
||||
FetchConstArray(att);
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
|
@ -44,7 +44,7 @@ namespace Module.Inspector.Editor
|
|||
return "Only supports integers";
|
||||
}
|
||||
|
||||
private void FetchConstArray(PopupFromConst attribute)
|
||||
private void FetchConstArray(PopupFromConstAttribute attribute)
|
||||
{
|
||||
if (names != null)
|
||||
return;
|
||||
|
|
@ -4,8 +4,8 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(QuaternionToEuler))]
|
||||
internal sealed class DrawerQuaternionToEuler : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(QuaternionToEulerAttribute))]
|
||||
internal sealed class QuaternionToEulerAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
public override bool Draw(Rect position, DrawerPropertyAttribute attribute, SerializedProperty property, GUIContent label, EditorPropertyUtility.Result result)
|
||||
{
|
||||
|
|
@ -6,8 +6,8 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(SceneDropdown))]
|
||||
internal sealed class DrawerSceneDropdown : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(SceneDropdownAttribute))]
|
||||
internal sealed class SceneDropdownAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
private static GUIContent[] NAMES;
|
||||
private static string[] PATHS;
|
||||
|
|
@ -4,13 +4,13 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(Slider))]
|
||||
internal sealed class DrawerSlider : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(SliderAttribute))]
|
||||
internal sealed class SliderAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
public override bool Draw(Rect position, DrawerPropertyAttribute attribute, SerializedProperty property, GUIContent label, EditorPropertyUtility.Result result)
|
||||
{
|
||||
var min = result.GetValueModifier<MinValue>();
|
||||
var max = result.GetValueModifier<MaxValue>();
|
||||
var min = result.GetValueModifier<MinValueAttribute>();
|
||||
var max = result.GetValueModifier<MaxValueAttribute>();
|
||||
|
||||
if (min == null || max == null)
|
||||
return false;
|
||||
|
|
@ -46,7 +46,7 @@ namespace Module.Inspector.Editor
|
|||
return "Only supports integer, float, vector2 and vector2int";
|
||||
}
|
||||
|
||||
private void DrawRange(Rect position, SerializedProperty property, GUIContent label, MinValue minValue, MaxValue maxValue)
|
||||
private void DrawRange(Rect position, SerializedProperty property, GUIContent label, MinValueAttribute minValueAttribute, MaxValueAttribute maxValueAttribute)
|
||||
{
|
||||
int indentLevel = EditorGUI.indentLevel;
|
||||
float indentSpacing = indentLevel * 15.0f;
|
||||
|
|
@ -63,10 +63,10 @@ namespace Module.Inspector.Editor
|
|||
switch (property.propertyType)
|
||||
{
|
||||
case SerializedPropertyType.Integer:
|
||||
property.intValue = EditorGUI.IntSlider(r1, property.intValue, minValue.intValue, maxValue.intValue);
|
||||
property.intValue = EditorGUI.IntSlider(r1, property.intValue, minValueAttribute.intValue, maxValueAttribute.intValue);
|
||||
break;
|
||||
case SerializedPropertyType.Float:
|
||||
property.floatValue = EditorGUI.Slider(r1, property.floatValue, minValue.floatValue, maxValue.floatValue);
|
||||
property.floatValue = EditorGUI.Slider(r1, property.floatValue, minValueAttribute.floatValue, maxValueAttribute.floatValue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -74,7 +74,7 @@ namespace Module.Inspector.Editor
|
|||
EditorGUI.indentLevel = indentLevel;
|
||||
}
|
||||
|
||||
private void DrawerMinMax(Rect position, SerializedProperty property, GUIContent label, MinValue min, MaxValue max)
|
||||
private void DrawerMinMax(Rect position, SerializedProperty property, GUIContent label, MinValueAttribute min, MaxValueAttribute max)
|
||||
{
|
||||
const float FLOAT_WIDTH = 50.0f;
|
||||
const float FLOAT_SPACING = 8.0f;
|
||||
|
|
@ -5,8 +5,8 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(StringToAnimatorParameter))]
|
||||
internal sealed class DrawerStringToAnimatorParameter : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(StringToAnimatorParameterAttribute))]
|
||||
internal sealed class StringToAnimatorParameterAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
private readonly List<string> names = new List<string>();
|
||||
private GUIContent[] contentArr;
|
||||
|
|
@ -16,7 +16,7 @@ namespace Module.Inspector.Editor
|
|||
if (property.propertyType != SerializedPropertyType.String)
|
||||
return false;
|
||||
|
||||
var att = (StringToAnimatorParameter)attribute;
|
||||
var att = (StringToAnimatorParameterAttribute)attribute;
|
||||
SerializedProperty spSibling = property.GetSibling(att.animatorFieldName);
|
||||
|
||||
if (spSibling == null)
|
||||
|
|
@ -49,7 +49,7 @@ namespace Module.Inspector.Editor
|
|||
if (property.propertyType != SerializedPropertyType.String)
|
||||
return "Only supports strings";
|
||||
|
||||
var att = (StringToAnimatorParameter)attribute;
|
||||
var att = (StringToAnimatorParameterAttribute)attribute;
|
||||
return $"Missing field: {att.animatorFieldName}";
|
||||
}
|
||||
|
||||
|
|
@ -4,15 +4,15 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(StringToField))]
|
||||
internal sealed class DrawerStringToField : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(StringToFieldAttribute))]
|
||||
internal sealed class StringToFieldAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
public override bool Draw(Rect position, DrawerPropertyAttribute attribute, SerializedProperty property, GUIContent label, EditorPropertyUtility.Result result)
|
||||
{
|
||||
if (property.propertyType != SerializedPropertyType.String)
|
||||
return false;
|
||||
|
||||
var att = (StringToField)attribute;
|
||||
var att = (StringToFieldAttribute)attribute;
|
||||
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
{
|
||||
|
|
@ -4,15 +4,15 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(StringToType))]
|
||||
internal sealed class DrawerStringToType : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(StringToTypeAttribute))]
|
||||
internal sealed class StringToTypeAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
public override bool Draw(Rect position, DrawerPropertyAttribute attribute, SerializedProperty property, GUIContent label, EditorPropertyUtility.Result result)
|
||||
{
|
||||
if (property.propertyType != SerializedPropertyType.String)
|
||||
return false;
|
||||
|
||||
var att = (StringToType)attribute;
|
||||
var att = (StringToTypeAttribute)attribute;
|
||||
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
{
|
||||
|
|
@ -5,8 +5,8 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(Tag))]
|
||||
internal sealed class DrawerTag : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(TagAttribute))]
|
||||
internal sealed class TagAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
private string[] names;
|
||||
private GUIContent[] contentArr;
|
||||
|
|
@ -4,8 +4,8 @@ using UnityEngine;
|
|||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(UrlGoTo))]
|
||||
internal sealed class DrawerUrlGoTo : DrawerPropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(UrlGoToAttribute))]
|
||||
internal sealed class UrlGoToAttributeDrawer : DrawerPropertyDrawer
|
||||
{
|
||||
public override bool Draw(Rect position, DrawerPropertyAttribute attribute, SerializedProperty property, GUIContent label, EditorPropertyUtility.Result result)
|
||||
{
|
||||
Loading…
Add table
Add a link
Reference in a new issue