Skip to content

Commit

Permalink
Fix method renaming in the same way
Browse files Browse the repository at this point in the history
  • Loading branch information
thegu5 committed Jan 19, 2024
1 parent dbbb257 commit dafbc42
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Il2CppInterop.Generator/Contexts/MethodRewriteContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit dafbc42

Please sign in to comment.