Skip to content

Commit

Permalink
Support prefixed types in ClassInjector.SystemTypeFromIl2CppType
Browse files Browse the repository at this point in the history
  • Loading branch information
ds5678 committed Sep 14, 2024
1 parent 89b8d31 commit 89e48dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Il2CppInterop.Runtime/Injection/ClassInjector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 89e48dc

Please sign in to comment.