@@ -24,6 +24,8 @@ static TestClass()
24
24
#endif
25
25
}
26
26
27
+ #region MONO
28
+
27
29
public static object LiterallyAnything = null ;
28
30
29
31
// Test enumerables
@@ -90,12 +92,12 @@ public static void TestComponent<T>() where T : Component
90
92
ExplorerCore . Log ( $ "Test3 { typeof ( T ) . FullName } ") ;
91
93
}
92
94
93
- public static void TestArgumentParse ( string _string ,
94
- int integer ,
95
- Color color ,
96
- CameraClearFlags flags ,
97
- Vector3 vector ,
98
- Quaternion quaternion ,
95
+ public static void TestArgumentParse ( string _string ,
96
+ int integer ,
97
+ Color color ,
98
+ CameraClearFlags flags ,
99
+ Vector3 vector ,
100
+ Quaternion quaternion ,
99
101
object obj ,
100
102
Type type ,
101
103
GameObject go )
@@ -145,6 +147,8 @@ private static void Init_Mono()
145
147
ExplorerCore . Log ( "Finished TestClass Init_Mono" ) ;
146
148
}
147
149
150
+ #endregion
151
+
148
152
#if CPP
149
153
public static Il2CppSystem . Collections . Generic . Dictionary < string , string > IL2CPP_Dict ;
150
154
public static Il2CppSystem . Collections . Generic . HashSet < string > IL2CPP_HashSet ;
@@ -156,7 +160,7 @@ private static void Init_Mono()
156
160
public static Il2CppSystem . Collections . IDictionary IL2CPP_IDict ;
157
161
public static Il2CppSystem . Collections . IList IL2CPP_IList ;
158
162
public static Dictionary < Il2CppSystem . Object , Il2CppSystem . Object > IL2CPP_BoxedDict ;
159
-
163
+
160
164
public static Il2CppSystem . Object IL2CPP_BoxedInt ;
161
165
public static Il2CppSystem . Int32 IL2CPP_Int ;
162
166
public static Il2CppSystem . Decimal IL2CPP_Decimal ;
@@ -185,31 +189,31 @@ private static void Init_IL2CPP()
185
189
IL2CPP_HashTable . Add ( "key1" , "value1" ) ;
186
190
IL2CPP_HashTable . Add ( "key2" , "value2" ) ;
187
191
IL2CPP_HashTable . Add ( "key3" , "value3" ) ;
188
-
192
+
189
193
ExplorerCore . Log ( $ "IL2CPP 3: Il2Cpp IDictionary") ;
190
194
var dict2 = new Il2CppSystem . Collections . Generic . Dictionary < string , string > ( ) ;
191
195
dict2 . Add ( "key1" , "value1" ) ;
192
196
IL2CPP_IDict = dict2 . TryCast < Il2CppSystem . Collections . IDictionary > ( ) ;
193
-
197
+
194
198
ExplorerCore . Log ( $ "IL2CPP 4: Il2Cpp List of Il2Cpp Object") ;
195
199
var list = new Il2CppSystem . Collections . Generic . List < Il2CppSystem . Object > ( 5 ) ;
196
200
list . Add ( "one" ) ;
197
201
list . Add ( "two" ) ;
198
202
IL2CPP_IList = list . TryCast < Il2CppSystem . Collections . IList > ( ) ;
199
-
203
+
200
204
ExplorerCore . Log ( $ "IL2CPP 5: Il2Cpp List of strings") ;
201
205
IL2CPP_ListString = new Il2CppSystem . Collections . Generic . List < string > ( ) ;
202
206
IL2CPP_ListString . Add ( "hello," ) ;
203
207
IL2CPP_ListString . Add ( "world!" ) ;
204
-
205
-
208
+
209
+
206
210
ExplorerCore . Log ( $ "IL2CPP 7: Dictionary of Il2Cpp String and Il2Cpp Object") ;
207
211
IL2CPP_BoxedDict = new ( ) ;
208
212
IL2CPP_BoxedDict [ ( Il2CppSystem . String ) "one" ] = new Il2CppSystem . Int32 { m_value = 1 } . BoxIl2CppObject ( ) ;
209
213
IL2CPP_BoxedDict [ ( Il2CppSystem . String ) "two" ] = new Il2CppSystem . Int32 { m_value = 2 } . BoxIl2CppObject ( ) ;
210
214
IL2CPP_BoxedDict [ ( Il2CppSystem . String ) "three" ] = new Il2CppSystem . Int32 { m_value = 3 } . BoxIl2CppObject ( ) ;
211
215
IL2CPP_BoxedDict [ ( Il2CppSystem . String ) "four" ] = new Il2CppSystem . Int32 { m_value = 4 } . BoxIl2CppObject ( ) ;
212
-
216
+
213
217
ExplorerCore . Log ( $ "IL2CPP 8: List of boxed Il2Cpp Objects") ;
214
218
IL2CPP_listOfBoxedObjects = new List < Il2CppSystem . Object > ( ) ;
215
219
IL2CPP_listOfBoxedObjects . Add ( ( Il2CppSystem . String ) "boxedString" ) ;
@@ -224,30 +228,30 @@ private static void Init_IL2CPP()
224
228
var boxedEnum = Il2CppSystem . Enum . Parse ( cppType , "Color" ) ;
225
229
IL2CPP_listOfBoxedObjects . Add ( boxedEnum ) ;
226
230
}
227
-
231
+
228
232
var structBox = Vector3 . one . BoxIl2CppObject ( ) ;
229
233
IL2CPP_listOfBoxedObjects . Add ( structBox ) ;
230
-
234
+
231
235
}
232
236
catch ( Exception ex )
233
237
{
234
238
ExplorerCore . LogWarning ( $ "Boxed enum test fail: { ex } ") ;
235
239
}
236
-
240
+
237
241
ExplorerCore . Log ( $ "IL2CPP 9: Il2Cpp struct array of ints") ;
238
242
IL2CPP_structArray = new UnhollowerBaseLib . Il2CppStructArray < int > ( 5 ) ;
239
243
IL2CPP_structArray [ 0 ] = 0 ;
240
244
IL2CPP_structArray [ 1 ] = 1 ;
241
245
IL2CPP_structArray [ 2 ] = 2 ;
242
246
IL2CPP_structArray [ 3 ] = 3 ;
243
247
IL2CPP_structArray [ 4 ] = 4 ;
244
-
248
+
245
249
ExplorerCore . Log ( $ "IL2CPP 10: Il2Cpp reference array of boxed objects") ;
246
250
IL2CPP_ReferenceArray = new UnhollowerBaseLib . Il2CppReferenceArray < Il2CppSystem . Object > ( 3 ) ;
247
251
IL2CPP_ReferenceArray [ 0 ] = new Il2CppSystem . Int32 { m_value = 5 } . BoxIl2CppObject ( ) ;
248
252
IL2CPP_ReferenceArray [ 1 ] = null ;
249
253
IL2CPP_ReferenceArray [ 2 ] = ( Il2CppSystem . String ) "whats up" ;
250
-
254
+
251
255
ExplorerCore . Log ( $ "IL2CPP 11: Misc il2cpp members") ;
252
256
IL2CPP_BoxedInt = new Il2CppSystem . Int32 ( ) { m_value = 5 } . BoxIl2CppObject ( ) ;
253
257
IL2CPP_Int = new Il2CppSystem . Int32 { m_value = 420 } ;
@@ -257,6 +261,7 @@ private static void Init_IL2CPP()
257
261
258
262
ExplorerCore . Log ( $ "Finished Init_Il2Cpp") ;
259
263
}
264
+
260
265
#endif
261
266
}
262
267
}
0 commit comments