File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Assets/com.alelievr.NodeGraphProcessor/Editor/Views Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -556,7 +556,13 @@ protected void AddInputContainer()
556556
557557 protected virtual void DrawDefaultInspector ( bool fromInspector = false )
558558 {
559- var fields = nodeTarget . GetType ( ) . GetFields ( BindingFlags . Public | BindingFlags . NonPublic | BindingFlags . Instance | BindingFlags . DeclaredOnly ) ;
559+ var fields = nodeTarget . GetType ( ) . GetFields ( BindingFlags . Public | BindingFlags . NonPublic | BindingFlags . Instance )
560+ // Filter fields from the BaseNode type since we are only interested in user-defined fields
561+ // (better than BindingFlags.DeclaredOnly because we keep any inherited user-defined fields)
562+ . Where ( f => f . DeclaringType != typeof ( BaseNode ) )
563+ // Order by MetadataToken to sync the order with the port order (make sure FieldDrawers are next to the correct port)
564+ //TODO: Also consider custom port order
565+ . OrderBy ( f => f . MetadataToken ) ;
560566
561567 foreach ( var field in fields )
562568 {
You can’t perform that action at this time.
0 commit comments