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
18
Editor/AccessModifiers/DisableFieldAttributeDrawer.cs
Normal file
18
Editor/AccessModifiers/DisableFieldAttributeDrawer.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using UnityEditor;
|
||||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(DisableFieldAttribute))]
|
||||
internal sealed class DisableFieldAttributeDrawer : AccessModifierPropertyDrawer
|
||||
{
|
||||
public override EAccessType GetAccessType(AccessModifierPropertyAttribute attribute, SerializedProperty property, EAccessType currentAccessType)
|
||||
{
|
||||
var att = (DisableFieldAttribute)attribute;
|
||||
|
||||
if (currentAccessType == EAccessType.Enabled && property.IsSiblingValue(att.fieldName, att.fieldValue, att.useFieldValue))
|
||||
currentAccessType = EAccessType.ReadOnly;
|
||||
|
||||
return currentAccessType;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue