From 7ab0c347f20f9c96cdb9a4af2c14be432307d926 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Thu, 7 Nov 2019 02:26:03 +0100 Subject: [PATCH] Model: Handle "in" and "ref" parameters --- Il2CppInspector/Reflection/ParameterInfo.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Il2CppInspector/Reflection/ParameterInfo.cs b/Il2CppInspector/Reflection/ParameterInfo.cs index 14cbf06..83e6180 100644 --- a/Il2CppInspector/Reflection/ParameterInfo.cs +++ b/Il2CppInspector/Reflection/ParameterInfo.cs @@ -28,6 +28,8 @@ namespace Il2CppInspector.Reflection // Default value for the parameter public object DefaultValue { get; } + public bool IsByRef => paramTypeUsage == ParameterType.Definition.byrefTypeIndex; + public bool IsIn => (Attributes & ParameterAttributes.In) != 0; public bool IsOptional => (Attributes & ParameterAttributes.Optional) != 0; public bool IsOut => (Attributes & ParameterAttributes.Out) != 0; @@ -86,6 +88,8 @@ namespace Il2CppInspector.Reflection } public string GetModifierString() => - (IsOut? "out " : ""); + (IsIn ? "in " : "") + + (IsByRef? "ref " : "") + + (IsOut? "out " : ""); } -} +} \ No newline at end of file