File tree Expand file tree Collapse file tree
Il2CppInterop.Generator/Passes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,7 +130,8 @@ private static PropertyDefinition GetOrCreateProperty(MethodDefinition unityMeth
130130 unityMethod . DeclaringType . Properties . Single (
131131 it => it . SetMethod == unityMethod || it . GetMethod == unityMethod ) ;
132132 var newProperty = newMethod . DeclaringType . Properties . SingleOrDefault ( it =>
133- it . Name == unityProperty . Name && it . Parameters . Count == unityProperty . Parameters . Count ) ;
133+ it . Name == unityProperty . Name && it . Parameters . Count == unityProperty . Parameters . Count &&
134+ it . Parameters . SequenceEqual ( unityProperty . Parameters , new TypeComparer ( ) ) ) ;
134135 if ( newProperty == null )
135136 {
136137 newProperty = new PropertyDefinition ( unityProperty . Name , PropertyAttributes . None ,
@@ -228,4 +229,23 @@ private static PropertyDefinition GetOrCreateProperty(MethodDefinition unityMeth
228229
229230 return newType ;
230231 }
232+
233+ //Stolen from: https://github.com/kremnev8/Il2CppInterop/blob/2c4a31f95f8aa6afe910aca0f8044efb80259d20/Il2CppInterop.Generator/Passes/Pass11ComputeTypeSpecifics.cs#L223
234+ internal sealed class TypeComparer : IEqualityComparer < ParameterDefinition >
235+ {
236+ public bool Equals ( ParameterDefinition x , ParameterDefinition y )
237+ {
238+ if ( x == null )
239+ return y == null ;
240+ if ( y == null )
241+ return false ;
242+
243+ return x . ParameterType . FullName . Equals ( y . ParameterType . FullName ) ;
244+ }
245+
246+ public int GetHashCode ( ParameterDefinition obj )
247+ {
248+ return obj . ParameterType . FullName . GetHashCode ( ) ;
249+ }
250+ }
231251}
You can’t perform that action at this time.
0 commit comments