Fixes several moves

This commit is contained in:
2025-02-01 15:26:57 +01:00
parent 00fe08dcd4
commit 0669f15a98
10 changed files with 49 additions and 12 deletions

View File

@@ -58,7 +58,7 @@ public class ScriptRegistry
var constructor = type.GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance,
null, Type.EmptyTypes, null);
if (constructor == null)
throw new ArgumentException($"Type {type} does not have a parameterless constructor.");
return;
// We create a lambda that creates a new instance of the script type.
// This is more performant than using Activator.CreateInstance.