Added PredrawerModifier to help modify either SerializedProperty or GUIContent before drawing
This commit is contained in:
parent
6321fcc107
commit
e0fc2c1e05
7 changed files with 62 additions and 3 deletions
|
|
@ -15,8 +15,16 @@ namespace Module.Inspector.Editor
|
|||
return;
|
||||
|
||||
label.tooltip = result.tooltip;
|
||||
|
||||
for (var i = 0; i < result.predrawerModifiers.Count; i++)
|
||||
{
|
||||
EditorPropertyUtility.ResultValue<PredrawerModifierPropertyAttribute, PredrawerModifierPropertyDrawer> value = result.predrawerModifiers[i];
|
||||
value.drawer.Modify(value.attribute, property, label);
|
||||
}
|
||||
|
||||
bool prevEnabled = GUI.enabled;
|
||||
GUI.enabled = accessType == EAccessType.Enabled;
|
||||
// TODO: What to do with [Obsolete]?
|
||||
|
||||
if (result.draw != null)
|
||||
{
|
||||
|
|
@ -50,7 +58,7 @@ namespace Module.Inspector.Editor
|
|||
return accessType != EAccessType.Hidden ? EditorGUI.GetPropertyHeight(property, label) : 0.0f;
|
||||
}
|
||||
|
||||
private EAccessType GetAccessType(SerializedProperty property, EditorPropertyUtility.Result result)
|
||||
private static EAccessType GetAccessType(SerializedProperty property, EditorPropertyUtility.Result result)
|
||||
{
|
||||
if (result.accessModifiers.Count == 0)
|
||||
return EAccessType.Enabled;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue