private static void StartScripts(ScriptStartup start) // Change this, it doesn't allow for scripts to run in multiple scenes { foreach (var script in ActiveScripts) { script.Stop(); } ActiveScripts.Clear(); foreach (var pair in Scripts) { if (pair.Key.Start == start) { var script = (IScript)Activator.CreateInstance(pair.Value); ActiveScripts.Add(script); script.Start(); } } }
public ScriptAttribute(ScriptStartup start) { Start = start; }