Skip to content

Commit 400ad63

Browse files
authored
Support prefixed types in ClassInjector.SystemTypeFromIl2CppType (#153)
1 parent bc570c3 commit 400ad63

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Il2CppInterop.Runtime/Injection/ClassInjector.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,9 @@ private static string GetIl2CppTypeFullName(Il2CppTypeStruct* typePointer)
11471147
internal static Type SystemTypeFromIl2CppType(Il2CppTypeStruct* typePointer)
11481148
{
11491149
var fullName = GetIl2CppTypeFullName(typePointer);
1150-
var type = Type.GetType(fullName) ?? throw new NullReferenceException($"Couldn't find System.Type for Il2Cpp type: {fullName}");
1150+
var type = Type.GetType(fullName)
1151+
?? Type.GetType(fullName.Contains('.') ? "Il2Cpp" + fullName : "Il2Cpp." + fullName)
1152+
?? throw new NullReferenceException($"Couldn't find System.Type for Il2Cpp type: {fullName}");
11511153

11521154
INativeTypeStruct wrappedType = UnityVersionHandler.Wrap(typePointer);
11531155
if (wrappedType.Type == Il2CppTypeEnum.IL2CPP_TYPE_GENERICINST)

0 commit comments

Comments
 (0)