1- #if ( MONOMELON || MONOBEPINEX )
1+ #if ( MONOMELON || MONOBEPINEX || IL2CPPBEPINEX )
22using System ;
3- # elif ( IL2CPPMELON || IL2CPPBEPINEX )
3+ # elif ( IL2CPPMELON )
44using Il2CppSystem ;
55using Il2CppInterop . Runtime ;
66using Il2CppInterop . Runtime . InteropTypes ;
@@ -21,9 +21,9 @@ internal static class CrossType
2121 /// <returns>The type of the class.</returns>
2222 internal static Type Of < T > ( )
2323 {
24- #if ( MONOMELON || MONOBEPINEX )
24+ #if ( MONOMELON || MONOBEPINEX || IL2CPPBEPINEX )
2525 return typeof ( T ) ;
26- # elif ( IL2CPPMELON || IL2CPPBEPINEX )
26+ # elif ( IL2CPPMELON )
2727 return Il2CppType . Of < T > ( ) ;
2828#endif
2929 }
@@ -36,13 +36,13 @@ internal static Type Of<T>()
3636 /// <typeparam name="T">The class we're checking against.</typeparam>
3737 /// <returns>Whether obj is of class T or not.</returns>
3838 internal static bool Is < T > ( object obj , out T result )
39- #if ( IL2CPPMELON || IL2CPPBEPINEX )
39+ #if ( IL2CPPMELON )
4040 where T : Il2CppObjectBase
41- #elif ( MONOMELON || MONOBEPINEX )
41+ #elif ( MONOMELON || MONOBEPINEX || IL2CPPBEPINEX )
4242 where T : class
4343#endif
4444 {
45- #if ( IL2CPPMELON || IL2CPPBEPINEX )
45+ #if ( IL2CPPMELON )
4646 if ( obj is Object il2CppObj)
4747 {
4848 Type il2CppType = Il2CppType . Of < T > ( ) ;
@@ -52,7 +52,7 @@ internal static bool Is<T>(object obj, out T result)
5252 return true ;
5353 }
5454 }
55- #elif ( MONOMELON || MONOBEPINEX )
55+ #elif ( MONOMELON || MONOBEPINEX || IL2CPPBEPINEX )
5656 if ( obj is T t)
5757 {
5858 result = t ;
@@ -71,15 +71,15 @@ internal static bool Is<T>(object obj, out T result)
7171 /// <typeparam name="T">The type to cast to.</typeparam>
7272 /// <returns>The object cast to the specified type.</returns>
7373 internal static T As < T > ( object obj )
74- #if ( IL2CPPMELON || IL2CPPBEPINEX )
74+ #if ( IL2CPPMELON )
7575 where T : Il2CppObjectBase
76- #elif ( MONOMELON || MONOBEPINEX )
76+ #elif ( MONOMELON || MONOBEPINEX || IL2CPPBEPINEX )
7777 where T : class
7878#endif
7979 =>
80- #if ( IL2CPPMELON || IL2CPPBEPINEX )
80+ #if ( IL2CPPMELON )
8181 obj is Object il2CppObj ? il2CppObj. Cast < T > ( ) : null ! ;
82- #elif ( MONOMELON || MONOBEPINEX )
82+ #elif ( MONOMELON || MONOBEPINEX || IL2CPPBEPINEX )
8383 ( T ) obj;
8484#endif
8585 }
0 commit comments