Clear VisjectSurface node caches and context menus during scripts reload

This commit is contained in:
2024-04-23 21:38:42 +03:00
parent 83b301684d
commit bdb28b8589
4 changed files with 29 additions and 2 deletions

View File

@@ -55,6 +55,12 @@ namespace FlaxEditor.Surface
{
_supportsImplicitCastFromObjectToBoolean = true;
DragHandlers.Add(_dragActors = new DragActors(ValidateDragActor));
ScriptsBuilder.ScriptsReloadBegin += OnScriptsReloadBegin;
}
private void OnScriptsReloadBegin()
{
_nodesCache.Clear();
}
private bool ValidateDragActor(ActorNode actor)
@@ -596,6 +602,7 @@ namespace FlaxEditor.Surface
{
if (IsDisposing)
return;
ScriptsBuilder.ScriptsReloadBegin -= OnScriptsReloadBegin;
_nodesCache.Wait();
base.OnDestroy();