Skip to content

Commit 5f74a10

Browse files
author
Daniel Burgess
committed
BUG Fix IN&OUT port fields from showing 2 drawers
1 parent 762d6d8 commit 5f74a10

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Assets/com.alelievr.NodeGraphProcessor/Editor/Views/BaseNodeView.cs

+7-8
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,6 @@ protected virtual void DrawFields(List<MemberInfo> fields, bool fromInspector =
704704
MemberInfo field = fields[i];
705705
if (!portsPerFieldName.ContainsKey(field.Name))
706706
{
707-
Debug.Log(field.Name);
708707
if (field.HasCustomAttribute<CustomBehaviourOnly>()) continue;
709708
DrawField(new MemberInfoWithPath(field), fromInspector);
710709
continue;
@@ -745,27 +744,26 @@ protected virtual void DrawField(MemberInfoWithPath fieldInfoWithPath, bool from
745744
bool serializeReference = field.HasCustomAttribute<SerializeReference>();
746745
if ((!field.IsPublic && !serializeField && !serializeReference) || field.IsNotSerialized)
747746
{
748-
Debug.Log("1 " + fieldPath);
749747
AddEmptyField(field, fromInspector);
750748
return;
751749
}
752750

753751
//skip if the field is an input/output and not marked as SerializedField
754752
InputAttribute inputAttribute = field.GetCustomAttribute<InputAttribute>();
755753
bool hasInputAttribute = inputAttribute != null;
756-
bool hasInputOrOutputAttribute = hasInputAttribute || field.HasCustomAttribute<OutputAttribute>();
757-
bool showAsDrawer = !fromInspector && hasInputAttribute && (inputAttribute.showAsDrawer || field.HasCustomAttribute<ShowAsDrawer>());
758-
showAsDrawer |= !fromInspector && (hasPortView && portView.direction == Direction.Input) && portData.showAsDrawer;
759-
if (((!serializeField && !serializeReference) || isProxied) && (hasPortView || hasInputOrOutputAttribute) && !showAsDrawer)
754+
bool isInput = (!hasPortView && hasInputAttribute) || (hasPortView && portView.direction == Direction.Input);
755+
bool showAsDrawer = !fromInspector && isInput && (inputAttribute.showAsDrawer || field.HasCustomAttribute<ShowAsDrawer>());
756+
showAsDrawer |= !fromInspector && isInput && portData.showAsDrawer;
757+
if (((!serializeField && !serializeReference) || isProxied) && (hasPortView || hasInputAttribute) && !showAsDrawer)
760758
{
761-
// if (fieldPath == "customInputs" || fieldPath == "customOutputs") return;
762759
AddEmptyField(field, fromInspector);
763760
return;
764761
}
765762

766763
//skip if marked with NonSerialized or HideInInspector
767-
if (field.HasCustomAttribute<System.NonSerializedAttribute>() || field.HasCustomAttribute<HideInInspector>())
764+
if (field.HasCustomAttribute<NonSerializedAttribute>() || field.HasCustomAttribute<HideInInspector>())
768765
{
766+
Debug.Log("3 " + fieldPath);
769767
AddEmptyField(field, fromInspector);
770768
return;
771769
}
@@ -774,6 +772,7 @@ protected virtual void DrawField(MemberInfoWithPath fieldInfoWithPath, bool from
774772
var showInInspector = field.GetCustomAttribute<ShowInInspector>();
775773
if (!serializeField && !serializeReference && showInInspector != null && !showInInspector.showInNode && !fromInspector)
776774
{
775+
Debug.Log("4 " + fieldPath);
777776
AddEmptyField(field, fromInspector);
778777
return;
779778
}

0 commit comments

Comments
 (0)