Add NodesConnected and NodesDisconnected events to Visject surface API
This commit is contained in:
@@ -320,6 +320,16 @@ namespace FlaxEditor.Surface
|
||||
/// </summary>
|
||||
public event Action<SurfaceNode> NodeBreakpointEdited;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when two nodes gets connected (via UI).
|
||||
/// </summary>
|
||||
public event Action<IConnectionInstigator, IConnectionInstigator> NodesConnected;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when two nodes gets disconnected (via UI).
|
||||
/// </summary>
|
||||
public event Action<IConnectionInstigator, IConnectionInstigator> NodesDisconnected;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="VisjectSurface"/> class.
|
||||
/// </summary>
|
||||
@@ -934,6 +944,23 @@ namespace FlaxEditor.Surface
|
||||
NodeDeleted?.Invoke(node);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when two nodes gets connected (via UI).
|
||||
/// </summary>
|
||||
public virtual void OnNodesConnected(IConnectionInstigator a, IConnectionInstigator b)
|
||||
{
|
||||
NodesConnected?.Invoke(a, b);
|
||||
MarkAsEdited();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when two nodes gets disconnected (via UI).
|
||||
/// </summary>
|
||||
public virtual void OnNodesDisconnected(IConnectionInstigator a, IConnectionInstigator b)
|
||||
{
|
||||
NodesDisconnected?.Invoke(a, b);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnDestroy()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user