mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-28 02:52:24 +08:00
1.4.5 (pre-release)
* Added MethodInfo support for basic methods with no arguments. * Added support for missing primitive types (char, short, byte) * Added CacheDictionary class (currently unsupported) * Cleaned up some stuff, using System.Reflection.MemberType instead of a custom enum.
This commit is contained in:
@ -72,6 +72,11 @@ namespace Explorer
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsArray(Type t)
|
||||
{
|
||||
return typeof(System.Collections.IEnumerable).IsAssignableFrom(t);
|
||||
}
|
||||
|
||||
public static bool IsList(Type t)
|
||||
{
|
||||
return t.IsGenericType
|
||||
@ -79,6 +84,13 @@ namespace Explorer
|
||||
&& (typeDef.IsAssignableFrom(typeof(List<>)) || typeDef.IsAssignableFrom(typeof(Il2CppSystem.Collections.Generic.List<>)));
|
||||
}
|
||||
|
||||
public static bool IsDictionary(Type t)
|
||||
{
|
||||
return t.IsGenericType
|
||||
&& t.GetGenericTypeDefinition() is Type typeDef
|
||||
&& typeDef.IsAssignableFrom(typeof(Il2CppSystem.Collections.Generic.Dictionary<,>));
|
||||
}
|
||||
|
||||
public static Type GetTypeByName(string typeName)
|
||||
{
|
||||
foreach (var asm in AppDomain.CurrentDomain.GetAssemblies())
|
||||
|
Reference in New Issue
Block a user