diff --git a/Il2CppInterop.Generator/Contexts/MethodRewriteContext.cs b/Il2CppInterop.Generator/Contexts/MethodRewriteContext.cs index 83f63f42..b20fffe2 100644 --- a/Il2CppInterop.Generator/Contexts/MethodRewriteContext.cs +++ b/Il2CppInterop.Generator/Contexts/MethodRewriteContext.cs @@ -242,9 +242,18 @@ private string UnmangleMethodNameWithSignature() { var unmangleMethodNameWithSignature = ProduceMethodSignatureBase() + "_" + DeclaringType.Methods .Where(ParameterSignatureMatchesThis).TakeWhile(it => it != this).Count(); + if (DeclaringType.AssemblyContext.GlobalContext.Options.RenameMap.TryGetValue( + DeclaringType.NewType.GetNamespacePrefix() + "." + DeclaringType.NewType.Name + "::" + unmangleMethodNameWithSignature, out var newNameByType)) + { + unmangleMethodNameWithSignature = newNameByType; + } + else if (DeclaringType.AssemblyContext.GlobalContext.Options.RenameMap.TryGetValue( DeclaringType.NewType.GetNamespacePrefix() + "::" + unmangleMethodNameWithSignature, out var newName)) + { unmangleMethodNameWithSignature = newName; + } + return unmangleMethodNameWithSignature; } diff --git a/Il2CppInterop.Generator/Passes/Pass70GenerateProperties.cs b/Il2CppInterop.Generator/Passes/Pass70GenerateProperties.cs index 0a174ca3..9a31cdee 100644 --- a/Il2CppInterop.Generator/Passes/Pass70GenerateProperties.cs +++ b/Il2CppInterop.Generator/Passes/Pass70GenerateProperties.cs @@ -85,8 +85,16 @@ private static string UnmanglePropertyName(AssemblyRewriteContext assemblyContex var unmanglePropertyName = baseName + "_" + index; if (assemblyContext.GlobalContext.Options.RenameMap.TryGetValue( - declaringType.GetNamespacePrefix() + "::" + unmanglePropertyName, out var newName)) + declaringType.GetNamespacePrefix() + "." + declaringType.Name + "::" + unmanglePropertyName, out var newNameByType)) + { + unmanglePropertyName = newNameByType; + } + else if (assemblyContext.GlobalContext.Options.RenameMap.TryGetValue( + declaringType.GetNamespacePrefix() + "::" + unmanglePropertyName, out var newName)) + { unmanglePropertyName = newName; + } + return unmanglePropertyName; }