Add SurfaceNodeActions for more contextual surface nodes scripting

This commit is contained in:
Wojtek Figat
2023-08-24 10:43:22 +02:00
parent 60e5c5446c
commit 952fe61515
23 changed files with 199 additions and 169 deletions

View File

@@ -315,9 +315,9 @@ namespace FlaxEditor.Surface
}
// Initialize
OnControlLoaded(comment);
comment.OnSurfaceLoaded();
OnControlSpawned(comment);
OnControlLoaded(comment, SurfaceNodeActions.User);
comment.OnSurfaceLoaded(SurfaceNodeActions.User);
OnControlSpawned(comment, SurfaceNodeActions.User);
MarkAsModified();
@@ -389,10 +389,10 @@ namespace FlaxEditor.Surface
throw new InvalidOperationException("Invalid node custom values.");
}
node.Location = location;
OnControlLoaded(node);
OnControlLoaded(node, SurfaceNodeActions.User);
beforeSpawned?.Invoke(node);
node.OnSurfaceLoaded();
OnControlSpawned(node);
node.OnSurfaceLoaded(SurfaceNodeActions.User);
OnControlSpawned(node, SurfaceNodeActions.User);
// Undo action
if (Surface != null)