diff --git a/Il2CppInterop.Runtime/Injection/ClassInjector.cs b/Il2CppInterop.Runtime/Injection/ClassInjector.cs index 6db08110..735929b2 100644 --- a/Il2CppInterop.Runtime/Injection/ClassInjector.cs +++ b/Il2CppInterop.Runtime/Injection/ClassInjector.cs @@ -1147,7 +1147,9 @@ private static string GetIl2CppTypeFullName(Il2CppTypeStruct* typePointer) internal static Type SystemTypeFromIl2CppType(Il2CppTypeStruct* typePointer) { var fullName = GetIl2CppTypeFullName(typePointer); - var type = Type.GetType(fullName) ?? throw new NullReferenceException($"Couldn't find System.Type for Il2Cpp type: {fullName}"); + var type = Type.GetType(fullName) + ?? Type.GetType(fullName.Contains('.') ? "Il2Cpp" + fullName : "Il2Cpp." + fullName) + ?? throw new NullReferenceException($"Couldn't find System.Type for Il2Cpp type: {fullName}"); INativeTypeStruct wrappedType = UnityVersionHandler.Wrap(typePointer); if (wrappedType.Type == Il2CppTypeEnum.IL2CPP_TYPE_GENERICINST)