Scripts - Properly register script with its owner

Scripts UI - Save on close
Scripts UI - Dispose script on removal
This commit is contained in:
Robert committed 2021-06-21 22:43:31 +02:00
1 parent 5367027471
commit a5c13bb543
5 files changed
+28 -1

No files matched your search

@@ -11,6 +11,10 @@ namespace Artemis.Core.ScriptingProviders
protected LayerScript(Layer layer, ScriptConfiguration configuration) : base(configuration)
{
Layer = layer;
lock (Layer.Scripts)
{
Layer.Scripts.Add(this);
}
}
/// <summary>
@@ -11,6 +11,10 @@ namespace Artemis.Core.ScriptingProviders
protected ProfileScript(Profile profile, ScriptConfiguration configuration) : base(configuration)
{
Profile = profile;
lock (Profile.Scripts)
{
Profile.Scripts.Add(this);
}
}
/// <summary>
@@ -10,6 +10,10 @@
protected PropertyScript(ILayerProperty layerProperty, ScriptConfiguration configuration) : base(configuration)
{
LayerProperty = layerProperty;
lock (LayerProperty.Scripts)
{
LayerProperty.Scripts.Add(this);
}
}
/// <summary>