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
24
Editor/AccessModifiers/ShowMethodAttributeDrawer.cs
Normal file
24
Editor/AccessModifiers/ShowMethodAttributeDrawer.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using System.Reflection;
|
||||
using Module.Inspector.Editor.Utilities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomMethodDrawer(typeof(ShowMethodAttribute))]
|
||||
internal sealed class ShowMethodAttributeDrawer : AccessModifierMethodDrawer
|
||||
{
|
||||
public override EAccessType GetAccessType(AccessModifierMethodAttribute attribute, Object target, MethodInfo methodInfo, EAccessType currentAccessType)
|
||||
{
|
||||
if (currentAccessType != EAccessType.Hidden && !GetVisibleValue(attribute, target))
|
||||
currentAccessType = EAccessType.Hidden;
|
||||
|
||||
return currentAccessType;
|
||||
}
|
||||
|
||||
private static bool GetVisibleValue(AccessModifierMethodAttribute attribute, Object target)
|
||||
{
|
||||
var att = (ShowMethodAttribute)attribute;
|
||||
return EditorSerializedPropertyUtility.IsValue(target, att.fieldName, att.fieldValue, att.useFieldValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue