Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomBehaviour Port drawers & Proxied Fields #204

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

dannymate
Copy link

@dannymate dannymate commented Feb 3, 2022

Solves issue: #202.

Added showAsDrawer to portdata, I initially created it as a replacement to ShowAsDrawer attribute but it turns out for what I was doing it wasn't required but I thought it may still be useful if creating a port without a backing field and you still want a property drawer.
Converted the single FieldInfo system in BaseNodeView to handle the new PortData field proxiedFieldPath. This is a path relative to the node the port is on. "fieldInNodeTarget.ChildFieldInThatField.etc.etc". I added a parser in BaseNodeView for this to create List. The methods in DrawDefaultInspector have been pertaining to AddControlField now use a List. In DrawDefaultInspector we check if it has any ports to its name and checks its portData to see if its being proxied and cycles through those. Other than some minor changes it piggybacks off of what already there this is largely due to FindSerializedProperty already uses the proxiedFieldPath format to get SeralizedProperty anyway.
I have added a few extension methods to make the code more readable.
I have provided an example of dynamic port generation with ProxiedFields.

image

Greebling and others added 28 commits October 11, 2021 11:20
This reverts commit a511e4a.
Added proxiedFieldPath to input for CustomPortBeh ports
Added ability to have property fields for dynamic ports.
Added GetNonRelayEdges List<SerializedEdge> extensions
@dannymate
Copy link
Author

I've noticed a couple issues.

  1. Error on edge disconnects
  2. Error on undo

I've fixed these in my branch but I've messed this pull request up a bit so I'll create a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants