forked from jacksondunstan/UnityNativeScripting
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBindings.cs
More file actions
3918 lines (3684 loc) · 158 KB
/
Copy pathBindings.cs
File metadata and controls
3918 lines (3684 loc) · 158 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using AOT;
using System;
using System.IO;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.Assertions;
namespace NativeScript
{
/// <summary>
/// Internals of the bindings between native and .NET code.
/// Game code shouldn't go here.
/// </summary>
/// <author>
/// Jackson Dunstan, 2017, http://JacksonDunstan.com
/// </author>
/// <license>
/// MIT
/// </license>
public static class Bindings
{
// Holds objects and provides handles to them in the form of ints
public static class ObjectStore
{
// Stored objects. The first is never used so 0 can be "null".
static object[] objects;
// Stack of available handles
static int[] handles;
// Hash table of stored objects to their handles.
static object[] keys;
static int[] values;
// Index of the next available handle
static int nextHandleIndex;
// The maximum number of objects to store. Must be positive.
static int maxObjects;
public static void Init(int maxObjects)
{
ObjectStore.maxObjects = maxObjects;
// Initialize the objects as all null plus room for the
// first to always be null.
objects = new object[maxObjects + 1];
// Initialize the handles stack as 1, 2, 3, ...
handles = new int[maxObjects];
for (
int i = 0, handle = maxObjects;
i < maxObjects;
++i, --handle)
{
handles[i] = handle;
}
nextHandleIndex = maxObjects - 1;
// Initialize the hash table
keys = new object[maxObjects];
values = new int[maxObjects];
}
public static int Store(object obj)
{
// Null is always zero
if (object.ReferenceEquals(obj, null))
{
return 0;
}
lock (objects)
{
// Pop a handle off the stack
int handle = handles[nextHandleIndex];
nextHandleIndex--;
// Store the object
objects[handle] = obj;
// Insert into the hash table
int initialIndex = (int)(
((uint)obj.GetHashCode()) % maxObjects);
int index = initialIndex;
do
{
if (object.ReferenceEquals(keys[index], null))
{
keys[index] = obj;
values[index] = handle;
break;
}
index = (index + 1) % maxObjects;
}
while (index != initialIndex);
return handle;
}
}
public static object Get(int handle)
{
return objects[handle];
}
public static int GetHandle(object obj)
{
// Null is always zero
if (object.ReferenceEquals(obj, null))
{
return 0;
}
lock (objects)
{
// Look up the object in the hash table
int initialIndex = (int)(
((uint)obj.GetHashCode()) % maxObjects);
int index = initialIndex;
do
{
if (object.ReferenceEquals(keys[index], obj))
{
return values[index];
}
index = (index + 1) % maxObjects;
}
while (index != initialIndex);
}
// Object not found
return Store(obj);
}
public static object Remove(int handle)
{
// Null is never stored, so there's nothing to remove
if (handle == 0)
{
return null;
}
lock (objects)
{
// Forget the object
object obj = objects[handle];
objects[handle] = null;
// Push the handle onto the stack
nextHandleIndex++;
handles[nextHandleIndex] = handle;
// Remove the object from the hash table
int initialIndex = (int)(
((uint)obj.GetHashCode()) % maxObjects);
int index = initialIndex;
do
{
if (object.ReferenceEquals(keys[index], obj))
{
// Only the key needs to be removed (set to null)
// because values corresponding to null will never
// be read and the values are just integers, so
// we're not holding on to a managed reference that
// will prevent GC.
keys[index] = null;
break;
}
index = (index + 1) % maxObjects;
}
while (index != initialIndex);
return obj;
}
}
}
// Holds structs and provides handles to them in the form of ints
public static class StructStore<T>
where T : struct
{
// Stored structs. The first is never used so 0 can be "null".
static T[] structs;
// Stack of available handles
static int[] handles;
// Index of the next available handle
static int nextHandleIndex;
public static void Init(int maxStructs)
{
// Initialize the objects as all default plus room for the
// first to always be unused.
structs = new T[maxStructs + 1];
// Initialize the handles stack as 1, 2, 3, ...
handles = new int[maxStructs];
for (
int i = 0, handle = maxStructs;
i < maxStructs;
++i, --handle)
{
handles[i] = handle;
}
nextHandleIndex = maxStructs - 1;
}
public static int Store(T structToStore)
{
lock (structs)
{
// Pop a handle off the stack
int handle = handles[nextHandleIndex];
nextHandleIndex--;
// Store the struct
structs[handle] = structToStore;
return handle;
}
}
public static void Replace(int handle, ref T structToStore)
{
structs[handle] = structToStore;
}
public static T Get(int handle)
{
return structs[handle];
}
public static void Remove(int handle)
{
if (handle != 0)
{
lock (structs)
{
// Forget the struct
structs[handle] = default(T);
// Push the handle onto the stack
nextHandleIndex++;
handles[nextHandleIndex] = handle;
}
}
}
}
// Name of the plugin when using [DllImport]
const string PluginName = "NativeScript";
// Path to load the plugin from when running inside the editor
#if UNITY_EDITOR_OSX
const string PluginPath = "/Plugins/Editor/NativeScript.bundle/Contents/MacOS/NativeScript";
#elif UNITY_EDITOR_LINUX
const string PluginPath = "/Plugins/Editor/libNativeScript.so";
#elif UNITY_EDITOR_WIN
const string PluginPath = "/Plugins/Editor/NativeScript.dll";
#endif
#if UNITY_EDITOR
// Handle to the C++ DLL
static IntPtr libraryHandle;
delegate void InitDelegate(
int maxManagedObjects,
IntPtr releaseObject,
IntPtr stringNew,
IntPtr setException,
IntPtr arrayGetLength,
IntPtr arrayGetRank,
/*BEGIN INIT PARAMS*/
IntPtr systemDiagnosticsStopwatchConstructor,
IntPtr systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds,
IntPtr systemDiagnosticsStopwatchMethodStart,
IntPtr systemDiagnosticsStopwatchMethodReset,
IntPtr unityEngineObjectPropertyGetName,
IntPtr unityEngineObjectPropertySetName,
IntPtr unityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject,
IntPtr unityEngineObjectMethodop_ImplicitUnityEngineObject,
IntPtr unityEngineGameObjectConstructor,
IntPtr unityEngineGameObjectConstructorSystemString,
IntPtr unityEngineGameObjectPropertyGetTransform,
IntPtr unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript,
IntPtr unityEngineComponentPropertyGetTransform,
IntPtr unityEngineTransformPropertyGetPosition,
IntPtr unityEngineTransformPropertySetPosition,
IntPtr unityEngineDebugMethodLogSystemObject,
IntPtr unityEngineAssertionsAssertFieldGetRaiseExceptions,
IntPtr unityEngineAssertionsAssertFieldSetRaiseExceptions,
IntPtr unityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString,
IntPtr unityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject,
IntPtr unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32,
IntPtr unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte,
IntPtr unityEngineNetworkingNetworkTransportMethodInit,
IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle,
IntPtr unityEngineVector3PropertyGetMagnitude,
IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle,
IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3,
IntPtr unityEngineVector3Methodop_UnaryNegationUnityEngineVector3,
IntPtr unityEngineMatrix4x4PropertyGetItem,
IntPtr unityEngineMatrix4x4PropertySetItem,
IntPtr releaseUnityEngineRaycastHit,
IntPtr unityEngineRaycastHitPropertyGetPoint,
IntPtr unityEngineRaycastHitPropertySetPoint,
IntPtr unityEngineRaycastHitPropertyGetTransform,
IntPtr releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble,
IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble,
IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey,
IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue,
IntPtr systemCollectionsGenericListSystemStringConstructor,
IntPtr systemCollectionsGenericListSystemStringPropertyGetItem,
IntPtr systemCollectionsGenericListSystemStringPropertySetItem,
IntPtr systemCollectionsGenericListSystemStringMethodAddSystemString,
IntPtr systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString,
IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue,
IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue,
IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString,
IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue,
IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue,
IntPtr systemExceptionConstructorSystemString,
IntPtr unityEngineResolutionPropertyGetWidth,
IntPtr unityEngineResolutionPropertySetWidth,
IntPtr unityEngineResolutionPropertyGetHeight,
IntPtr unityEngineResolutionPropertySetHeight,
IntPtr unityEngineResolutionPropertyGetRefreshRate,
IntPtr unityEngineResolutionPropertySetRefreshRate,
IntPtr unityEngineScreenPropertyGetResolutions,
IntPtr unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3,
IntPtr unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit,
IntPtr unityEnginePhysicsMethodRaycastAllUnityEngineRay,
IntPtr unityEngineGradientConstructor,
IntPtr unityEngineGradientPropertyGetColorKeys,
IntPtr unityEngineGradientPropertySetColorKeys,
IntPtr systemAppDomainSetupConstructor,
IntPtr systemAppDomainSetupPropertyGetAppDomainInitializer,
IntPtr systemAppDomainSetupPropertySetAppDomainInitializer,
IntPtr systemInt32Array1Constructor1,
IntPtr systemInt32Array1GetItem1,
IntPtr systemInt32Array1SetItem1,
IntPtr systemSingleArray1Constructor1,
IntPtr systemSingleArray1GetItem1,
IntPtr systemSingleArray1SetItem1,
IntPtr systemSingleArray2Constructor2,
IntPtr systemSingleArray2GetLength2,
IntPtr systemSingleArray2GetItem2,
IntPtr systemSingleArray2SetItem2,
IntPtr systemSingleArray3Constructor3,
IntPtr systemSingleArray3GetLength3,
IntPtr systemSingleArray3GetItem3,
IntPtr systemSingleArray3SetItem3,
IntPtr systemStringArray1Constructor1,
IntPtr systemStringArray1GetItem1,
IntPtr systemStringArray1SetItem1,
IntPtr unityEngineResolutionArray1Constructor1,
IntPtr unityEngineResolutionArray1GetItem1,
IntPtr unityEngineResolutionArray1SetItem1,
IntPtr unityEngineRaycastHitArray1Constructor1,
IntPtr unityEngineRaycastHitArray1GetItem1,
IntPtr unityEngineRaycastHitArray1SetItem1,
IntPtr unityEngineGradientColorKeyArray1Constructor1,
IntPtr unityEngineGradientColorKeyArray1GetItem1,
IntPtr unityEngineGradientColorKeyArray1SetItem1,
IntPtr releaseSystemAction,
IntPtr systemActionConstructor,
IntPtr systemActionInvoke,
IntPtr systemActionAdd,
IntPtr systemActionRemove,
IntPtr releaseSystemActionSystemSingle,
IntPtr systemActionSystemSingleConstructor,
IntPtr systemActionSystemSingleInvoke,
IntPtr systemActionSystemSingleAdd,
IntPtr systemActionSystemSingleRemove,
IntPtr releaseSystemActionSystemSingle_SystemSingle,
IntPtr systemActionSystemSingle_SystemSingleConstructor,
IntPtr systemActionSystemSingle_SystemSingleInvoke,
IntPtr systemActionSystemSingle_SystemSingleAdd,
IntPtr systemActionSystemSingle_SystemSingleRemove,
IntPtr releaseSystemFuncSystemInt32_SystemSingle_SystemDouble,
IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor,
IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke,
IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleAdd,
IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleRemove,
IntPtr releaseSystemFuncSystemInt16_SystemInt32_SystemString,
IntPtr systemFuncSystemInt16_SystemInt32_SystemStringConstructor,
IntPtr systemFuncSystemInt16_SystemInt32_SystemStringInvoke,
IntPtr systemFuncSystemInt16_SystemInt32_SystemStringAdd,
IntPtr systemFuncSystemInt16_SystemInt32_SystemStringRemove,
IntPtr releaseSystemAppDomainInitializer,
IntPtr systemAppDomainInitializerConstructor,
IntPtr systemAppDomainInitializerInvoke,
IntPtr systemAppDomainInitializerAdd,
IntPtr systemAppDomainInitializerRemove
/*END INIT PARAMS*/);
public delegate void SetCsharpExceptionDelegate(int handle);
/*BEGIN MONOBEHAVIOUR DELEGATES*/
public delegate void MyGameMonoBehavioursTestScriptAwakeDelegate(int thisHandle);
public static MyGameMonoBehavioursTestScriptAwakeDelegate MyGameMonoBehavioursTestScriptAwake;
public delegate void MyGameMonoBehavioursTestScriptOnAnimatorIKDelegate(int thisHandle, int param0);
public static MyGameMonoBehavioursTestScriptOnAnimatorIKDelegate MyGameMonoBehavioursTestScriptOnAnimatorIK;
public delegate void MyGameMonoBehavioursTestScriptOnCollisionEnterDelegate(int thisHandle, int param0);
public static MyGameMonoBehavioursTestScriptOnCollisionEnterDelegate MyGameMonoBehavioursTestScriptOnCollisionEnter;
public delegate void MyGameMonoBehavioursTestScriptUpdateDelegate(int thisHandle);
public static MyGameMonoBehavioursTestScriptUpdateDelegate MyGameMonoBehavioursTestScriptUpdate;
public delegate void SystemActionCppInvokeDelegate(int thisHandle);
public static SystemActionCppInvokeDelegate SystemActionCppInvoke;
public delegate void SystemActionSystemSingleCppInvokeDelegate(int thisHandle, float param0);
public static SystemActionSystemSingleCppInvokeDelegate SystemActionSystemSingleCppInvoke;
public delegate void SystemActionSystemSingle_SystemSingleCppInvokeDelegate(int thisHandle, float param0, float param1);
public static SystemActionSystemSingle_SystemSingleCppInvokeDelegate SystemActionSystemSingle_SystemSingleCppInvoke;
public delegate double SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvokeDelegate(int thisHandle, int param0, float param1);
public static SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvokeDelegate SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke;
public delegate int SystemFuncSystemInt16_SystemInt32_SystemStringCppInvokeDelegate(int thisHandle, short param0, int param1);
public static SystemFuncSystemInt16_SystemInt32_SystemStringCppInvokeDelegate SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke;
public delegate void SystemAppDomainInitializerCppInvokeDelegate(int thisHandle, int param0);
public static SystemAppDomainInitializerCppInvokeDelegate SystemAppDomainInitializerCppInvoke;
public delegate void SetCsharpExceptionSystemNullReferenceExceptionDelegate(int param0);
public static SetCsharpExceptionSystemNullReferenceExceptionDelegate SetCsharpExceptionSystemNullReferenceException;
/*END MONOBEHAVIOUR DELEGATES*/
#endif
#if UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX
[DllImport("__Internal")]
static extern IntPtr dlopen(
string path,
int flag);
[DllImport("__Internal")]
static extern IntPtr dlsym(
IntPtr handle,
string symbolName);
[DllImport("__Internal")]
static extern int dlclose(
IntPtr handle);
static IntPtr OpenLibrary(
string path)
{
IntPtr handle = dlopen(path, 0);
if (handle == IntPtr.Zero)
{
throw new Exception("Couldn't open native library: " + path);
}
return handle;
}
static void CloseLibrary(
IntPtr libraryHandle)
{
dlclose(libraryHandle);
}
static T GetDelegate<T>(
IntPtr libraryHandle,
string functionName) where T : class
{
IntPtr symbol = dlsym(libraryHandle, functionName);
if (symbol == IntPtr.Zero)
{
throw new Exception("Couldn't get function: " + functionName);
}
return Marshal.GetDelegateForFunctionPointer(
symbol,
typeof(T)) as T;
}
#elif UNITY_EDITOR_WIN
[DllImport("kernel32")]
static extern IntPtr LoadLibrary(
string path);
[DllImport("kernel32")]
static extern IntPtr GetProcAddress(
IntPtr libraryHandle,
string symbolName);
[DllImport("kernel32")]
static extern bool FreeLibrary(
IntPtr libraryHandle);
static IntPtr OpenLibrary(string path)
{
IntPtr handle = LoadLibrary(path);
if (handle == IntPtr.Zero)
{
throw new Exception("Couldn't open native library: " + path);
}
return handle;
}
static void CloseLibrary(IntPtr libraryHandle)
{
FreeLibrary(libraryHandle);
}
static T GetDelegate<T>(
IntPtr libraryHandle,
string functionName) where T : class
{
IntPtr symbol = GetProcAddress(libraryHandle, functionName);
if (symbol == IntPtr.Zero)
{
throw new Exception("Couldn't get function: " + functionName);
}
return Marshal.GetDelegateForFunctionPointer(
symbol,
typeof(T)) as T;
}
#else
[DllImport(PluginName)]
static extern void Init(
int maxManagedObjects,
IntPtr releaseObject,
IntPtr stringNew,
IntPtr setException,
IntPtr arrayGetLength,
IntPtr arrayGetRank,
/*BEGIN INIT PARAMS*/
IntPtr systemDiagnosticsStopwatchConstructor,
IntPtr systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds,
IntPtr systemDiagnosticsStopwatchMethodStart,
IntPtr systemDiagnosticsStopwatchMethodReset,
IntPtr unityEngineObjectPropertyGetName,
IntPtr unityEngineObjectPropertySetName,
IntPtr unityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject,
IntPtr unityEngineObjectMethodop_ImplicitUnityEngineObject,
IntPtr unityEngineGameObjectConstructor,
IntPtr unityEngineGameObjectConstructorSystemString,
IntPtr unityEngineGameObjectPropertyGetTransform,
IntPtr unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript,
IntPtr unityEngineComponentPropertyGetTransform,
IntPtr unityEngineTransformPropertyGetPosition,
IntPtr unityEngineTransformPropertySetPosition,
IntPtr unityEngineDebugMethodLogSystemObject,
IntPtr unityEngineAssertionsAssertFieldGetRaiseExceptions,
IntPtr unityEngineAssertionsAssertFieldSetRaiseExceptions,
IntPtr unityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString,
IntPtr unityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject,
IntPtr unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32,
IntPtr unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte,
IntPtr unityEngineNetworkingNetworkTransportMethodInit,
IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle,
IntPtr unityEngineVector3PropertyGetMagnitude,
IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle,
IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3,
IntPtr unityEngineVector3Methodop_UnaryNegationUnityEngineVector3,
IntPtr unityEngineMatrix4x4PropertyGetItem,
IntPtr unityEngineMatrix4x4PropertySetItem,
IntPtr releaseUnityEngineRaycastHit,
IntPtr unityEngineRaycastHitPropertyGetPoint,
IntPtr unityEngineRaycastHitPropertySetPoint,
IntPtr unityEngineRaycastHitPropertyGetTransform,
IntPtr releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble,
IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble,
IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey,
IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue,
IntPtr systemCollectionsGenericListSystemStringConstructor,
IntPtr systemCollectionsGenericListSystemStringPropertyGetItem,
IntPtr systemCollectionsGenericListSystemStringPropertySetItem,
IntPtr systemCollectionsGenericListSystemStringMethodAddSystemString,
IntPtr systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString,
IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue,
IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue,
IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString,
IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue,
IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue,
IntPtr systemExceptionConstructorSystemString,
IntPtr unityEngineResolutionPropertyGetWidth,
IntPtr unityEngineResolutionPropertySetWidth,
IntPtr unityEngineResolutionPropertyGetHeight,
IntPtr unityEngineResolutionPropertySetHeight,
IntPtr unityEngineResolutionPropertyGetRefreshRate,
IntPtr unityEngineResolutionPropertySetRefreshRate,
IntPtr unityEngineScreenPropertyGetResolutions,
IntPtr unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3,
IntPtr unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit,
IntPtr unityEnginePhysicsMethodRaycastAllUnityEngineRay,
IntPtr unityEngineGradientConstructor,
IntPtr unityEngineGradientPropertyGetColorKeys,
IntPtr unityEngineGradientPropertySetColorKeys,
IntPtr systemAppDomainSetupConstructor,
IntPtr systemAppDomainSetupPropertyGetAppDomainInitializer,
IntPtr systemAppDomainSetupPropertySetAppDomainInitializer,
IntPtr systemInt32Array1Constructor1,
IntPtr systemInt32Array1GetItem1,
IntPtr systemInt32Array1SetItem1,
IntPtr systemSingleArray1Constructor1,
IntPtr systemSingleArray1GetItem1,
IntPtr systemSingleArray1SetItem1,
IntPtr systemSingleArray2Constructor2,
IntPtr systemSingleArray2GetLength2,
IntPtr systemSingleArray2GetItem2,
IntPtr systemSingleArray2SetItem2,
IntPtr systemSingleArray3Constructor3,
IntPtr systemSingleArray3GetLength3,
IntPtr systemSingleArray3GetItem3,
IntPtr systemSingleArray3SetItem3,
IntPtr systemStringArray1Constructor1,
IntPtr systemStringArray1GetItem1,
IntPtr systemStringArray1SetItem1,
IntPtr unityEngineResolutionArray1Constructor1,
IntPtr unityEngineResolutionArray1GetItem1,
IntPtr unityEngineResolutionArray1SetItem1,
IntPtr unityEngineRaycastHitArray1Constructor1,
IntPtr unityEngineRaycastHitArray1GetItem1,
IntPtr unityEngineRaycastHitArray1SetItem1,
IntPtr unityEngineGradientColorKeyArray1Constructor1,
IntPtr unityEngineGradientColorKeyArray1GetItem1,
IntPtr unityEngineGradientColorKeyArray1SetItem1,
IntPtr releaseSystemAction,
IntPtr systemActionConstructor,
IntPtr systemActionInvoke,
IntPtr systemActionAdd,
IntPtr systemActionRemove,
IntPtr releaseSystemActionSystemSingle,
IntPtr systemActionSystemSingleConstructor,
IntPtr systemActionSystemSingleInvoke,
IntPtr systemActionSystemSingleAdd,
IntPtr systemActionSystemSingleRemove,
IntPtr releaseSystemActionSystemSingle_SystemSingle,
IntPtr systemActionSystemSingle_SystemSingleConstructor,
IntPtr systemActionSystemSingle_SystemSingleInvoke,
IntPtr systemActionSystemSingle_SystemSingleAdd,
IntPtr systemActionSystemSingle_SystemSingleRemove,
IntPtr releaseSystemFuncSystemInt32_SystemSingle_SystemDouble,
IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor,
IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke,
IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleAdd,
IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleRemove,
IntPtr releaseSystemFuncSystemInt16_SystemInt32_SystemString,
IntPtr systemFuncSystemInt16_SystemInt32_SystemStringConstructor,
IntPtr systemFuncSystemInt16_SystemInt32_SystemStringInvoke,
IntPtr systemFuncSystemInt16_SystemInt32_SystemStringAdd,
IntPtr systemFuncSystemInt16_SystemInt32_SystemStringRemove,
IntPtr releaseSystemAppDomainInitializer,
IntPtr systemAppDomainInitializerConstructor,
IntPtr systemAppDomainInitializerInvoke,
IntPtr systemAppDomainInitializerAdd,
IntPtr systemAppDomainInitializerRemove
/*END INIT PARAMS*/);
[DllImport(PluginName)]
static extern void SetCsharpException(int handle);
/*BEGIN MONOBEHAVIOUR IMPORTS*/
[DllImport(Constants.PluginName)]
public static extern void MyGameMonoBehavioursTestScriptAwake(int thisHandle);
[DllImport(Constants.PluginName)]
public static extern void MyGameMonoBehavioursTestScriptOnAnimatorIK(int thisHandle, int param0);
[DllImport(Constants.PluginName)]
public static extern void MyGameMonoBehavioursTestScriptOnCollisionEnter(int thisHandle, int param0);
[DllImport(Constants.PluginName)]
public static extern void MyGameMonoBehavioursTestScriptUpdate(int thisHandle);
[DllImport(Constants.PluginName)]
public static extern void SystemActionCppInvoke(int thisHandle);
[DllImport(Constants.PluginName)]
public static extern void SystemActionSystemSingleCppInvoke(int thisHandle, int param0);
[DllImport(Constants.PluginName)]
public static extern void SystemActionSystemSingle_SystemSingleCppInvoke(int thisHandle, int param0, int param1);
[DllImport(Constants.PluginName)]
public static extern void SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke(int thisHandle, int param0, int param1);
[DllImport(Constants.PluginName)]
public static extern void SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke(int thisHandle, int param0, int param1);
[DllImport(Constants.PluginName)]
public static extern void SystemAppDomainInitializerCppInvoke(int thisHandle, int param0);
[DllImport(Constants.PluginName)]
public static extern void SetCsharpExceptionSystemNullReferenceException(int thisHandle, int param0);
/*END MONOBEHAVIOUR IMPORTS*/
#endif
delegate void ReleaseObjectDelegate(int handle);
delegate int StringNewDelegate(string chars);
delegate void SetExceptionDelegate(int handle);
delegate int ArrayGetLengthDelegate(int handle);
delegate int ArrayGetRankDelegate(int handle);
/*BEGIN DELEGATE TYPES*/
delegate int SystemDiagnosticsStopwatchConstructorDelegate();
delegate long SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate(int thisHandle);
delegate void SystemDiagnosticsStopwatchMethodStartDelegate(int thisHandle);
delegate void SystemDiagnosticsStopwatchMethodResetDelegate(int thisHandle);
delegate int UnityEngineObjectPropertyGetNameDelegate(int thisHandle);
delegate void UnityEngineObjectPropertySetNameDelegate(int thisHandle, int valueHandle);
delegate bool UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObjectDelegate(int xHandle, int yHandle);
delegate bool UnityEngineObjectMethodop_ImplicitUnityEngineObjectDelegate(int existsHandle);
delegate int UnityEngineGameObjectConstructorDelegate();
delegate int UnityEngineGameObjectConstructorSystemStringDelegate(int nameHandle);
delegate int UnityEngineGameObjectPropertyGetTransformDelegate(int thisHandle);
delegate int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate(int thisHandle);
delegate int UnityEngineComponentPropertyGetTransformDelegate(int thisHandle);
delegate UnityEngine.Vector3 UnityEngineTransformPropertyGetPositionDelegate(int thisHandle);
delegate void UnityEngineTransformPropertySetPositionDelegate(int thisHandle, ref UnityEngine.Vector3 value);
delegate void UnityEngineDebugMethodLogSystemObjectDelegate(int messageHandle);
delegate bool UnityEngineAssertionsAssertFieldGetRaiseExceptionsDelegate();
delegate void UnityEngineAssertionsAssertFieldSetRaiseExceptionsDelegate(bool value);
delegate void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemStringDelegate(int expectedHandle, int actualHandle);
delegate void UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObjectDelegate(int expectedHandle, int actualHandle);
delegate void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate(ref int bufferLength, ref int numBuffers);
delegate void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate(int hostId, ref int addressHandle, ref int port, ref byte error);
delegate void UnityEngineNetworkingNetworkTransportMethodInitDelegate();
delegate UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate(float x, float y, float z);
delegate float UnityEngineVector3PropertyGetMagnitudeDelegate(ref UnityEngine.Vector3 thiz);
delegate void UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingleDelegate(ref UnityEngine.Vector3 thiz, float newX, float newY, float newZ);
delegate UnityEngine.Vector3 UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3Delegate(ref UnityEngine.Vector3 a, ref UnityEngine.Vector3 b);
delegate UnityEngine.Vector3 UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3Delegate(ref UnityEngine.Vector3 a);
delegate float UnityEngineMatrix4x4PropertyGetItemDelegate(ref UnityEngine.Matrix4x4 thiz, int row, int column);
delegate void UnityEngineMatrix4x4PropertySetItemDelegate(ref UnityEngine.Matrix4x4 thiz, int row, int column, float value);
delegate void ReleaseUnityEngineRaycastHitDelegate(int handle);
delegate UnityEngine.Vector3 UnityEngineRaycastHitPropertyGetPointDelegate(int thisHandle);
delegate void UnityEngineRaycastHitPropertySetPointDelegate(int thisHandle, ref UnityEngine.Vector3 value);
delegate int UnityEngineRaycastHitPropertyGetTransformDelegate(int thisHandle);
delegate void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate(int handle);
delegate int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDoubleDelegate(int keyHandle, double value);
delegate int SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKeyDelegate(int thisHandle);
delegate double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate(int thisHandle);
delegate int SystemCollectionsGenericListSystemStringConstructorDelegate();
delegate int SystemCollectionsGenericListSystemStringPropertyGetItemDelegate(int thisHandle, int index);
delegate void SystemCollectionsGenericListSystemStringPropertySetItemDelegate(int thisHandle, int index, int valueHandle);
delegate void SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate(int thisHandle, int itemHandle);
delegate int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate(int valueHandle);
delegate int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValueDelegate(int thisHandle);
delegate void SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate(int thisHandle, int valueHandle);
delegate int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemStringDelegate(int valueHandle);
delegate int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate(int thisHandle);
delegate void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate(int thisHandle, int valueHandle);
delegate int SystemExceptionConstructorSystemStringDelegate(int messageHandle);
delegate int UnityEngineResolutionPropertyGetWidthDelegate(ref UnityEngine.Resolution thiz);
delegate void UnityEngineResolutionPropertySetWidthDelegate(ref UnityEngine.Resolution thiz, int value);
delegate int UnityEngineResolutionPropertyGetHeightDelegate(ref UnityEngine.Resolution thiz);
delegate void UnityEngineResolutionPropertySetHeightDelegate(ref UnityEngine.Resolution thiz, int value);
delegate int UnityEngineResolutionPropertyGetRefreshRateDelegate(ref UnityEngine.Resolution thiz);
delegate void UnityEngineResolutionPropertySetRefreshRateDelegate(ref UnityEngine.Resolution thiz, int value);
delegate int UnityEngineScreenPropertyGetResolutionsDelegate();
delegate UnityEngine.Ray UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction);
delegate int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitDelegate(ref UnityEngine.Ray ray, int resultsHandle);
delegate int UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate(ref UnityEngine.Ray ray);
delegate int UnityEngineGradientConstructorDelegate();
delegate int UnityEngineGradientPropertyGetColorKeysDelegate(int thisHandle);
delegate void UnityEngineGradientPropertySetColorKeysDelegate(int thisHandle, int valueHandle);
delegate int SystemAppDomainSetupConstructorDelegate();
delegate int SystemAppDomainSetupPropertyGetAppDomainInitializerDelegate(int thisHandle);
delegate void SystemAppDomainSetupPropertySetAppDomainInitializerDelegate(int thisHandle, int valueHandle);
delegate int SystemInt32Array1Constructor1Delegate(int length0);
delegate int SystemInt32Array1GetItem1Delegate(int thisHandle, int index0);
delegate void SystemInt32Array1SetItem1Delegate(int thisHandle, int index0, int item);
delegate int SystemSingleArray1Constructor1Delegate(int length0);
delegate float SystemSingleArray1GetItem1Delegate(int thisHandle, int index0);
delegate void SystemSingleArray1SetItem1Delegate(int thisHandle, int index0, float item);
delegate int SystemSingleArray2Constructor2Delegate(int length0, int length1);
delegate int SystemSingleArray2GetLength2Delegate(int thisHandle, int dimension);
delegate float SystemSingleArray2GetItem2Delegate(int thisHandle, int index0, int index1);
delegate void SystemSingleArray2SetItem2Delegate(int thisHandle, int index0, int index1, float item);
delegate int SystemSingleArray3Constructor3Delegate(int length0, int length1, int length2);
delegate int SystemSingleArray3GetLength3Delegate(int thisHandle, int dimension);
delegate float SystemSingleArray3GetItem3Delegate(int thisHandle, int index0, int index1, int index2);
delegate void SystemSingleArray3SetItem3Delegate(int thisHandle, int index0, int index1, int index2, float item);
delegate int SystemStringArray1Constructor1Delegate(int length0);
delegate int SystemStringArray1GetItem1Delegate(int thisHandle, int index0);
delegate void SystemStringArray1SetItem1Delegate(int thisHandle, int index0, int itemHandle);
delegate int UnityEngineResolutionArray1Constructor1Delegate(int length0);
delegate UnityEngine.Resolution UnityEngineResolutionArray1GetItem1Delegate(int thisHandle, int index0);
delegate void UnityEngineResolutionArray1SetItem1Delegate(int thisHandle, int index0, ref UnityEngine.Resolution item);
delegate int UnityEngineRaycastHitArray1Constructor1Delegate(int length0);
delegate int UnityEngineRaycastHitArray1GetItem1Delegate(int thisHandle, int index0);
delegate void UnityEngineRaycastHitArray1SetItem1Delegate(int thisHandle, int index0, int itemHandle);
delegate int UnityEngineGradientColorKeyArray1Constructor1Delegate(int length0);
delegate UnityEngine.GradientColorKey UnityEngineGradientColorKeyArray1GetItem1Delegate(int thisHandle, int index0);
delegate void UnityEngineGradientColorKeyArray1SetItem1Delegate(int thisHandle, int index0, ref UnityEngine.GradientColorKey item);
delegate void SystemActionConstructorDelegate(int cppHandle, ref int handle, ref int classHandle);
delegate void ReleaseSystemActionDelegate(int handle, int classHandle);
delegate void SystemActionInvokeDelegate(int thisHandle);
delegate void SystemActionAddDelegate(int thisHandle, int delHandle);
delegate void SystemActionRemoveDelegate(int thisHandle, int delHandle);
delegate void SystemActionSystemSingleConstructorDelegate(int cppHandle, ref int handle, ref int classHandle);
delegate void ReleaseSystemActionSystemSingleDelegate(int handle, int classHandle);
delegate void SystemActionSystemSingleInvokeDelegate(int thisHandle, float obj);
delegate void SystemActionSystemSingleAddDelegate(int thisHandle, int delHandle);
delegate void SystemActionSystemSingleRemoveDelegate(int thisHandle, int delHandle);
delegate void SystemActionSystemSingle_SystemSingleConstructorDelegate(int cppHandle, ref int handle, ref int classHandle);
delegate void ReleaseSystemActionSystemSingle_SystemSingleDelegate(int handle, int classHandle);
delegate void SystemActionSystemSingle_SystemSingleInvokeDelegate(int thisHandle, float arg1, float arg2);
delegate void SystemActionSystemSingle_SystemSingleAddDelegate(int thisHandle, int delHandle);
delegate void SystemActionSystemSingle_SystemSingleRemoveDelegate(int thisHandle, int delHandle);
delegate void SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructorDelegate(int cppHandle, ref int handle, ref int classHandle);
delegate void ReleaseSystemFuncSystemInt32_SystemSingle_SystemDoubleDelegate(int handle, int classHandle);
delegate double SystemFuncSystemInt32_SystemSingle_SystemDoubleInvokeDelegate(int thisHandle, int arg1, float arg2);
delegate void SystemFuncSystemInt32_SystemSingle_SystemDoubleAddDelegate(int thisHandle, int delHandle);
delegate void SystemFuncSystemInt32_SystemSingle_SystemDoubleRemoveDelegate(int thisHandle, int delHandle);
delegate void SystemFuncSystemInt16_SystemInt32_SystemStringConstructorDelegate(int cppHandle, ref int handle, ref int classHandle);
delegate void ReleaseSystemFuncSystemInt16_SystemInt32_SystemStringDelegate(int handle, int classHandle);
delegate int SystemFuncSystemInt16_SystemInt32_SystemStringInvokeDelegate(int thisHandle, short arg1, int arg2);
delegate void SystemFuncSystemInt16_SystemInt32_SystemStringAddDelegate(int thisHandle, int delHandle);
delegate void SystemFuncSystemInt16_SystemInt32_SystemStringRemoveDelegate(int thisHandle, int delHandle);
delegate void SystemAppDomainInitializerConstructorDelegate(int cppHandle, ref int handle, ref int classHandle);
delegate void ReleaseSystemAppDomainInitializerDelegate(int handle, int classHandle);
delegate void SystemAppDomainInitializerInvokeDelegate(int thisHandle, int argsHandle);
delegate void SystemAppDomainInitializerAddDelegate(int thisHandle, int delHandle);
delegate void SystemAppDomainInitializerRemoveDelegate(int thisHandle, int delHandle);
/*END DELEGATE TYPES*/
public static Exception UnhandledCppException;
public static SetCsharpExceptionDelegate SetCsharpException;
/// <summary>
/// Open the C++ plugin and call its PluginMain()
/// </summary>
///
/// <param name="maxManagedObjects">
/// Maximum number of simultaneous managed objects that the C++ plugin
/// uses.
/// </param>
public static void Open(
int maxManagedObjects)
{
ObjectStore.Init(maxManagedObjects);
/*BEGIN STRUCTSTORE INIT CALLS*/
NativeScript.Bindings.StructStore<UnityEngine.RaycastHit>.Init(1000);
NativeScript.Bindings.StructStore<System.Collections.Generic.KeyValuePair<string, double>>.Init(maxManagedObjects);
/*END STRUCTSTORE INIT CALLS*/
#if UNITY_EDITOR
// Open native library
libraryHandle = OpenLibrary(
Application.dataPath + PluginPath);
InitDelegate Init = GetDelegate<InitDelegate>(
libraryHandle,
"Init");
SetCsharpException = GetDelegate<SetCsharpExceptionDelegate>(
libraryHandle,
"SetCsharpException");
/*BEGIN MONOBEHAVIOUR GETDELEGATE CALLS*/
MyGameMonoBehavioursTestScriptAwake = GetDelegate<MyGameMonoBehavioursTestScriptAwakeDelegate>(libraryHandle, "MyGameMonoBehavioursTestScriptAwake");
MyGameMonoBehavioursTestScriptOnAnimatorIK = GetDelegate<MyGameMonoBehavioursTestScriptOnAnimatorIKDelegate>(libraryHandle, "MyGameMonoBehavioursTestScriptOnAnimatorIK");
MyGameMonoBehavioursTestScriptOnCollisionEnter = GetDelegate<MyGameMonoBehavioursTestScriptOnCollisionEnterDelegate>(libraryHandle, "MyGameMonoBehavioursTestScriptOnCollisionEnter");
MyGameMonoBehavioursTestScriptUpdate = GetDelegate<MyGameMonoBehavioursTestScriptUpdateDelegate>(libraryHandle, "MyGameMonoBehavioursTestScriptUpdate");
SystemActionCppInvoke = GetDelegate<SystemActionCppInvokeDelegate>(libraryHandle, "SystemActionCppInvoke");
SystemActionSystemSingleCppInvoke = GetDelegate<SystemActionSystemSingleCppInvokeDelegate>(libraryHandle, "SystemActionSystemSingleCppInvoke");
SystemActionSystemSingle_SystemSingleCppInvoke = GetDelegate<SystemActionSystemSingle_SystemSingleCppInvokeDelegate>(libraryHandle, "SystemActionSystemSingle_SystemSingleCppInvoke");
SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke = GetDelegate<SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvokeDelegate>(libraryHandle, "SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke");
SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke = GetDelegate<SystemFuncSystemInt16_SystemInt32_SystemStringCppInvokeDelegate>(libraryHandle, "SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke");
SystemAppDomainInitializerCppInvoke = GetDelegate<SystemAppDomainInitializerCppInvokeDelegate>(libraryHandle, "SystemAppDomainInitializerCppInvoke");
SetCsharpExceptionSystemNullReferenceException = GetDelegate<SetCsharpExceptionSystemNullReferenceExceptionDelegate>(libraryHandle, "SetCsharpExceptionSystemNullReferenceException");
/*END MONOBEHAVIOUR GETDELEGATE CALLS*/
#endif
// Init C++ library
Init(
maxManagedObjects,
Marshal.GetFunctionPointerForDelegate(new ReleaseObjectDelegate(ReleaseObject)),
Marshal.GetFunctionPointerForDelegate(new StringNewDelegate(StringNew)),
Marshal.GetFunctionPointerForDelegate(new SetExceptionDelegate(SetException)),
Marshal.GetFunctionPointerForDelegate(new ArrayGetLengthDelegate(ArrayGetLength)),
Marshal.GetFunctionPointerForDelegate(new ArrayGetRankDelegate(ArrayGetRank)),
/*BEGIN INIT CALL*/
Marshal.GetFunctionPointerForDelegate(new SystemDiagnosticsStopwatchConstructorDelegate(SystemDiagnosticsStopwatchConstructor)),
Marshal.GetFunctionPointerForDelegate(new SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate(SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)),
Marshal.GetFunctionPointerForDelegate(new SystemDiagnosticsStopwatchMethodStartDelegate(SystemDiagnosticsStopwatchMethodStart)),
Marshal.GetFunctionPointerForDelegate(new SystemDiagnosticsStopwatchMethodResetDelegate(SystemDiagnosticsStopwatchMethodReset)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineObjectPropertyGetNameDelegate(UnityEngineObjectPropertyGetName)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineObjectPropertySetNameDelegate(UnityEngineObjectPropertySetName)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObjectDelegate(UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineObjectMethodop_ImplicitUnityEngineObjectDelegate(UnityEngineObjectMethodop_ImplicitUnityEngineObject)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectConstructorDelegate(UnityEngineGameObjectConstructor)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectConstructorSystemStringDelegate(UnityEngineGameObjectConstructorSystemString)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectPropertyGetTransformDelegate(UnityEngineGameObjectPropertyGetTransform)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineComponentPropertyGetTransformDelegate(UnityEngineComponentPropertyGetTransform)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineTransformPropertyGetPositionDelegate(UnityEngineTransformPropertyGetPosition)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineTransformPropertySetPositionDelegate(UnityEngineTransformPropertySetPosition)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineDebugMethodLogSystemObjectDelegate(UnityEngineDebugMethodLogSystemObject)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineAssertionsAssertFieldGetRaiseExceptionsDelegate(UnityEngineAssertionsAssertFieldGetRaiseExceptions)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineAssertionsAssertFieldSetRaiseExceptionsDelegate(UnityEngineAssertionsAssertFieldSetRaiseExceptions)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemStringDelegate(UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObjectDelegate(UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate(UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate(UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineNetworkingNetworkTransportMethodInitDelegate(UnityEngineNetworkingNetworkTransportMethodInit)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3PropertyGetMagnitudeDelegate(UnityEngineVector3PropertyGetMagnitude)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingleDelegate(UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3Delegate(UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3Delegate(UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineMatrix4x4PropertyGetItemDelegate(UnityEngineMatrix4x4PropertyGetItem)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineMatrix4x4PropertySetItemDelegate(UnityEngineMatrix4x4PropertySetItem)),
Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineRaycastHitDelegate(ReleaseUnityEngineRaycastHit)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetPointDelegate(UnityEngineRaycastHitPropertyGetPoint)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertySetPointDelegate(UnityEngineRaycastHitPropertySetPoint)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetTransformDelegate(UnityEngineRaycastHitPropertyGetTransform)),
Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate(ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble)),
Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDoubleDelegate(SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble)),
Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKeyDelegate(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey)),
Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)),
Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringConstructorDelegate(SystemCollectionsGenericListSystemStringConstructor)),
Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringPropertyGetItemDelegate(SystemCollectionsGenericListSystemStringPropertyGetItem)),
Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringPropertySetItemDelegate(SystemCollectionsGenericListSystemStringPropertySetItem)),
Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate(SystemCollectionsGenericListSystemStringMethodAddSystemString)),
Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate(SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString)),
Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValueDelegate(SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue)),
Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate(SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue)),
Marshal.GetFunctionPointerForDelegate(new SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemStringDelegate(SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString)),
Marshal.GetFunctionPointerForDelegate(new SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)),
Marshal.GetFunctionPointerForDelegate(new SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)),
Marshal.GetFunctionPointerForDelegate(new SystemExceptionConstructorSystemStringDelegate(SystemExceptionConstructorSystemString)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionPropertyGetWidthDelegate(UnityEngineResolutionPropertyGetWidth)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionPropertySetWidthDelegate(UnityEngineResolutionPropertySetWidth)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionPropertyGetHeightDelegate(UnityEngineResolutionPropertyGetHeight)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionPropertySetHeightDelegate(UnityEngineResolutionPropertySetHeight)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionPropertyGetRefreshRateDelegate(UnityEngineResolutionPropertyGetRefreshRate)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionPropertySetRefreshRateDelegate(UnityEngineResolutionPropertySetRefreshRate)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineScreenPropertyGetResolutionsDelegate(UnityEngineScreenPropertyGetResolutions)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate(UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)),
Marshal.GetFunctionPointerForDelegate(new UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitDelegate(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)),
Marshal.GetFunctionPointerForDelegate(new UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate(UnityEnginePhysicsMethodRaycastAllUnityEngineRay)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientConstructorDelegate(UnityEngineGradientConstructor)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientPropertyGetColorKeysDelegate(UnityEngineGradientPropertyGetColorKeys)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientPropertySetColorKeysDelegate(UnityEngineGradientPropertySetColorKeys)),
Marshal.GetFunctionPointerForDelegate(new SystemAppDomainSetupConstructorDelegate(SystemAppDomainSetupConstructor)),
Marshal.GetFunctionPointerForDelegate(new SystemAppDomainSetupPropertyGetAppDomainInitializerDelegate(SystemAppDomainSetupPropertyGetAppDomainInitializer)),
Marshal.GetFunctionPointerForDelegate(new SystemAppDomainSetupPropertySetAppDomainInitializerDelegate(SystemAppDomainSetupPropertySetAppDomainInitializer)),
Marshal.GetFunctionPointerForDelegate(new SystemInt32Array1Constructor1Delegate(SystemInt32Array1Constructor1)),
Marshal.GetFunctionPointerForDelegate(new SystemInt32Array1GetItem1Delegate(SystemInt32Array1GetItem1)),
Marshal.GetFunctionPointerForDelegate(new SystemInt32Array1SetItem1Delegate(SystemInt32Array1SetItem1)),
Marshal.GetFunctionPointerForDelegate(new SystemSingleArray1Constructor1Delegate(SystemSingleArray1Constructor1)),
Marshal.GetFunctionPointerForDelegate(new SystemSingleArray1GetItem1Delegate(SystemSingleArray1GetItem1)),
Marshal.GetFunctionPointerForDelegate(new SystemSingleArray1SetItem1Delegate(SystemSingleArray1SetItem1)),
Marshal.GetFunctionPointerForDelegate(new SystemSingleArray2Constructor2Delegate(SystemSingleArray2Constructor2)),
Marshal.GetFunctionPointerForDelegate(new SystemSingleArray2GetLength2Delegate(SystemSingleArray2GetLength2)),
Marshal.GetFunctionPointerForDelegate(new SystemSingleArray2GetItem2Delegate(SystemSingleArray2GetItem2)),
Marshal.GetFunctionPointerForDelegate(new SystemSingleArray2SetItem2Delegate(SystemSingleArray2SetItem2)),
Marshal.GetFunctionPointerForDelegate(new SystemSingleArray3Constructor3Delegate(SystemSingleArray3Constructor3)),
Marshal.GetFunctionPointerForDelegate(new SystemSingleArray3GetLength3Delegate(SystemSingleArray3GetLength3)),
Marshal.GetFunctionPointerForDelegate(new SystemSingleArray3GetItem3Delegate(SystemSingleArray3GetItem3)),
Marshal.GetFunctionPointerForDelegate(new SystemSingleArray3SetItem3Delegate(SystemSingleArray3SetItem3)),
Marshal.GetFunctionPointerForDelegate(new SystemStringArray1Constructor1Delegate(SystemStringArray1Constructor1)),
Marshal.GetFunctionPointerForDelegate(new SystemStringArray1GetItem1Delegate(SystemStringArray1GetItem1)),
Marshal.GetFunctionPointerForDelegate(new SystemStringArray1SetItem1Delegate(SystemStringArray1SetItem1)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionArray1Constructor1Delegate(UnityEngineResolutionArray1Constructor1)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionArray1GetItem1Delegate(UnityEngineResolutionArray1GetItem1)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionArray1SetItem1Delegate(UnityEngineResolutionArray1SetItem1)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitArray1Constructor1Delegate(UnityEngineRaycastHitArray1Constructor1)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitArray1GetItem1Delegate(UnityEngineRaycastHitArray1GetItem1)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitArray1SetItem1Delegate(UnityEngineRaycastHitArray1SetItem1)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientColorKeyArray1Constructor1Delegate(UnityEngineGradientColorKeyArray1Constructor1)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientColorKeyArray1GetItem1Delegate(UnityEngineGradientColorKeyArray1GetItem1)),
Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientColorKeyArray1SetItem1Delegate(UnityEngineGradientColorKeyArray1SetItem1)),
Marshal.GetFunctionPointerForDelegate(new ReleaseSystemActionDelegate(ReleaseSystemAction)),
Marshal.GetFunctionPointerForDelegate(new SystemActionConstructorDelegate(SystemActionConstructor)),
Marshal.GetFunctionPointerForDelegate(new SystemActionInvokeDelegate(SystemActionInvoke)),
Marshal.GetFunctionPointerForDelegate(new SystemActionAddDelegate(SystemActionAdd)),
Marshal.GetFunctionPointerForDelegate(new SystemActionRemoveDelegate(SystemActionRemove)),
Marshal.GetFunctionPointerForDelegate(new ReleaseSystemActionSystemSingleDelegate(ReleaseSystemActionSystemSingle)),
Marshal.GetFunctionPointerForDelegate(new SystemActionSystemSingleConstructorDelegate(SystemActionSystemSingleConstructor)),
Marshal.GetFunctionPointerForDelegate(new SystemActionSystemSingleInvokeDelegate(SystemActionSystemSingleInvoke)),
Marshal.GetFunctionPointerForDelegate(new SystemActionSystemSingleAddDelegate(SystemActionSystemSingleAdd)),
Marshal.GetFunctionPointerForDelegate(new SystemActionSystemSingleRemoveDelegate(SystemActionSystemSingleRemove)),
Marshal.GetFunctionPointerForDelegate(new ReleaseSystemActionSystemSingle_SystemSingleDelegate(ReleaseSystemActionSystemSingle_SystemSingle)),
Marshal.GetFunctionPointerForDelegate(new SystemActionSystemSingle_SystemSingleConstructorDelegate(SystemActionSystemSingle_SystemSingleConstructor)),
Marshal.GetFunctionPointerForDelegate(new SystemActionSystemSingle_SystemSingleInvokeDelegate(SystemActionSystemSingle_SystemSingleInvoke)),
Marshal.GetFunctionPointerForDelegate(new SystemActionSystemSingle_SystemSingleAddDelegate(SystemActionSystemSingle_SystemSingleAdd)),
Marshal.GetFunctionPointerForDelegate(new SystemActionSystemSingle_SystemSingleRemoveDelegate(SystemActionSystemSingle_SystemSingleRemove)),
Marshal.GetFunctionPointerForDelegate(new ReleaseSystemFuncSystemInt32_SystemSingle_SystemDoubleDelegate(ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble)),
Marshal.GetFunctionPointerForDelegate(new SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructorDelegate(SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor)),
Marshal.GetFunctionPointerForDelegate(new SystemFuncSystemInt32_SystemSingle_SystemDoubleInvokeDelegate(SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)),
Marshal.GetFunctionPointerForDelegate(new SystemFuncSystemInt32_SystemSingle_SystemDoubleAddDelegate(SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd)),
Marshal.GetFunctionPointerForDelegate(new SystemFuncSystemInt32_SystemSingle_SystemDoubleRemoveDelegate(SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove)),
Marshal.GetFunctionPointerForDelegate(new ReleaseSystemFuncSystemInt16_SystemInt32_SystemStringDelegate(ReleaseSystemFuncSystemInt16_SystemInt32_SystemString)),
Marshal.GetFunctionPointerForDelegate(new SystemFuncSystemInt16_SystemInt32_SystemStringConstructorDelegate(SystemFuncSystemInt16_SystemInt32_SystemStringConstructor)),
Marshal.GetFunctionPointerForDelegate(new SystemFuncSystemInt16_SystemInt32_SystemStringInvokeDelegate(SystemFuncSystemInt16_SystemInt32_SystemStringInvoke)),
Marshal.GetFunctionPointerForDelegate(new SystemFuncSystemInt16_SystemInt32_SystemStringAddDelegate(SystemFuncSystemInt16_SystemInt32_SystemStringAdd)),
Marshal.GetFunctionPointerForDelegate(new SystemFuncSystemInt16_SystemInt32_SystemStringRemoveDelegate(SystemFuncSystemInt16_SystemInt32_SystemStringRemove)),
Marshal.GetFunctionPointerForDelegate(new ReleaseSystemAppDomainInitializerDelegate(ReleaseSystemAppDomainInitializer)),