Added TypeOf

This commit is contained in:
EvilFactory
2022-11-14 14:31:38 -03:00
parent 3ba75e5c44
commit 2931ef00ea
2 changed files with 8 additions and 0 deletions
@@ -88,6 +88,13 @@ namespace Barotrauma
return type == targetType;
}
public static string TypeOf(object obj)
{
if (obj == null) { throw new ScriptRuntimeException("userdata is nil"); }
return obj.GetType().FullName;
}
public static object CreateStatic(string typeName)
{
Type type = GetType(typeName);