When doing Undo command i lose most of my outputs edges on my custom nodes (on any graph). Am pretty sure my code is the issue (my method may be outdated) but just and case i will post a issues.
Here how most of my dynamic outputs are done
public virtual IEnumerable<PortData> ListPortBehavior(List<SerializableEdge> edges)
{
int outputPortCount = Mathf.Max(1, edges.Count + 1);
for (int i = 0; i < outputPortCount; i++)
{
yield return new PortData
{
displayName = "child " + i,
displayType = typeof(BehaviorTreeLink),
identifier = i.ToString(), // Must be unique
vertical = true,
};
}
}
And and class NodeView i do
//Work around
public override void Enable()
{
nodeTarget.onAfterEdgeConnected += OnStructuralChange;
nodeTarget.onAfterEdgeDisconnected += OnStructuralChange;
}
void OnStructuralChange(SerializableEdge _) => ForceUpdatePorts();
When doing Undo command i lose most of my outputs edges on my custom nodes (on any graph). Am pretty sure my code is the issue (my method may be outdated) but just and case i will post a issues.
Here how most of my dynamic outputs are done
And and class NodeView i do