Made ParseUtility helper to simplify and improve parsing of various input types

This commit is contained in:
Sinai
2021-05-09 01:25:26 +10:00
parent c828d9b642
commit c04a864b74
12 changed files with 512 additions and 106 deletions

View File

@ -92,17 +92,23 @@ namespace UnityExplorer
public static string ReflectionExToString(this Exception e, bool innerMost = true)
{
if (innerMost)
{
while (e.InnerException != null)
{
if (e.InnerException is System.Runtime.CompilerServices.RuntimeWrappedException)
break;
e = e.InnerException;
}
}
e.GetInnerMostException();
return $"{e.GetType()}: {e.Message}";
}
public static Exception GetInnerMostException(this Exception e)
{
while (e.InnerException != null)
{
#if CPP
if (e.InnerException is System.Runtime.CompilerServices.RuntimeWrappedException)
break;
#endif
e = e.InnerException;
}
return e;
}
}
}

View File

@ -275,7 +275,7 @@ namespace UnityExplorer
var name = toType.AssemblyQualifiedName;
if (!unboxMethods.ContainsKey(toType.AssemblyQualifiedName))
if (!unboxMethods.ContainsKey(name))
{
unboxMethods.Add(name, typeof(Il2CppObjectBase)
.GetMethod("Unbox")

View File

@ -182,7 +182,6 @@ namespace UnityExplorer
#endregion
#region Type and Generic Parameter implementation cache
// cache for GetImplementationsOf
@ -302,7 +301,6 @@ namespace UnityExplorer
#endregion
#region Internal MemberInfo Cache
internal static Dictionary<Type, Dictionary<string, FieldInfo>> fieldInfos = new Dictionary<Type, Dictionary<string, FieldInfo>>();