7
7
using BF = System . Reflection . BindingFlags ;
8
8
using UnityExplorer . Core . Runtime ;
9
9
10
- namespace UnityExplorer . Core
10
+ namespace UnityExplorer
11
11
{
12
12
public static class ReflectionUtility
13
13
{
@@ -18,7 +18,7 @@ public static class ReflectionUtility
18
18
/// </summary>
19
19
/// <param name="obj">The object to get the true Type for.</param>
20
20
/// <returns>The most accurate Type of the object which could be identified.</returns>
21
- public static Type GetType ( this object obj )
21
+ public static Type GetActualType ( this object obj )
22
22
{
23
23
if ( obj == null )
24
24
return null ;
@@ -32,7 +32,7 @@ public static Type GetType(this object obj)
32
32
/// <param name="obj">The object to cast</param>
33
33
/// <returns>The object, cast to the underlying Type if possible, otherwise the original object.</returns>
34
34
public static object Cast ( this object obj )
35
- => ReflectionProvider . Instance . Cast ( obj , GetType ( obj ) ) ;
35
+ => ReflectionProvider . Instance . Cast ( obj , GetActualType ( obj ) ) ;
36
36
37
37
/// <summary>
38
38
/// Cast an object to a Type, if possible.
@@ -105,7 +105,7 @@ from type in asm.TryGetTypes()
105
105
/// <summary>
106
106
/// Get all base types of the provided Type, including itself.
107
107
/// </summary>
108
- public static Type [ ] GetAllBaseTypes ( this object obj ) => GetAllBaseTypes ( GetType ( obj ) ) ;
108
+ public static Type [ ] GetAllBaseTypes ( this object obj ) => GetAllBaseTypes ( GetActualType ( obj ) ) ;
109
109
110
110
/// <summary>
111
111
/// Get all base types of the provided Type, including itself.
0 commit comments