@@ -570,7 +570,7 @@ protected virtual void DrawDefaultInspector(bool fromInspector = false)
570
570
//skip if the field is not serializable
571
571
if ( ! field . IsPublic && field . GetCustomAttribute ( typeof ( SerializeField ) ) == null )
572
572
{
573
- AddEmptyField ( field ) ;
573
+ AddEmptyField ( field , fromInspector ) ;
574
574
continue ;
575
575
}
576
576
@@ -581,22 +581,22 @@ protected virtual void DrawDefaultInspector(bool fromInspector = false)
581
581
bool showAsDrawer = ! fromInspector && field . GetCustomAttribute ( typeof ( ShowAsDrawer ) ) != null ;
582
582
if ( field . GetCustomAttribute ( typeof ( SerializeField ) ) == null && hasInputOrOutputAttribute && ! showAsDrawer )
583
583
{
584
- AddEmptyField ( field ) ;
584
+ AddEmptyField ( field , fromInspector ) ;
585
585
continue ;
586
586
}
587
587
588
588
//skip if marked with NonSerialized or HideInInspector
589
589
if ( field . GetCustomAttribute ( typeof ( System . NonSerializedAttribute ) ) != null || field . GetCustomAttribute ( typeof ( HideInInspector ) ) != null )
590
590
{
591
- AddEmptyField ( field ) ;
591
+ AddEmptyField ( field , fromInspector ) ;
592
592
continue ;
593
593
}
594
594
595
595
// Hide the field if we want to display in in the inspector
596
596
var showInInspector = field . GetCustomAttribute < ShowInInspector > ( ) ;
597
597
if ( showInInspector != null && ! showInInspector . showInNode && ! fromInspector )
598
598
{
599
- AddEmptyField ( field ) ;
599
+ AddEmptyField ( field , fromInspector ) ;
600
600
continue ;
601
601
}
602
602
@@ -618,9 +618,9 @@ protected virtual void DrawDefaultInspector(bool fromInspector = false)
618
618
}
619
619
}
620
620
621
- private void AddEmptyField ( FieldInfo field )
621
+ private void AddEmptyField ( FieldInfo field , bool fromInspector )
622
622
{
623
- if ( field . GetCustomAttribute ( typeof ( InputAttribute ) ) == null ) return ;
623
+ if ( field . GetCustomAttribute ( typeof ( InputAttribute ) ) == null || fromInspector ) return ;
624
624
625
625
var box = new VisualElement { name = field . Name } ;
626
626
box . AddToClassList ( "port-input-element" ) ;
0 commit comments